hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
1 value
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
5
1.02k
max_stars_repo_name
stringlengths
4
126
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
sequence
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
5
1.02k
max_issues_repo_name
stringlengths
4
114
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
sequence
max_issues_count
float64
1
92.2k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
5
1.02k
max_forks_repo_name
stringlengths
4
136
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
sequence
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
avg_line_length
float64
2.55
99.9
max_line_length
int64
3
1k
alphanum_fraction
float64
0.25
1
index
int64
0
1M
content
stringlengths
3
1.05M
9244e4eb19eebc2658485007daa64ed4c376621f
1,694
java
Java
external/rocksdb/java/src/main/java/org/rocksdb/BackupInfo.java
devafrica/cpacoin
ef2e86d7fc5b73d380eed3f471ff62b495443ba5
[ "BSD-3-Clause" ]
12,278
2015-01-29T17:11:33.000Z
2022-03-31T21:12:00.000Z
external/rocksdb/java/src/main/java/org/rocksdb/BackupInfo.java
devafrica/cpacoin
ef2e86d7fc5b73d380eed3f471ff62b495443ba5
[ "BSD-3-Clause" ]
9,469
2015-01-30T05:33:07.000Z
2022-03-31T16:17:21.000Z
external/rocksdb/java/src/main/java/org/rocksdb/BackupInfo.java
devafrica/cpacoin
ef2e86d7fc5b73d380eed3f471ff62b495443ba5
[ "BSD-3-Clause" ]
1,731
2017-12-09T15:09:43.000Z
2022-03-30T18:23:38.000Z
22
94
0.662338
1,003,179
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). package org.rocksdb; /** * Instances of this class describe a Backup made by * {@link org.rocksdb.BackupEngine}. */ public class BackupInfo { /** * Package private constructor used to create instances * of BackupInfo by {@link org.rocksdb.BackupEngine} * * @param backupId id of backup * @param timestamp timestamp of backup * @param size size of backup * @param numberFiles number of files related to this backup. */ BackupInfo(final int backupId, final long timestamp, final long size, final int numberFiles, final String app_metadata) { backupId_ = backupId; timestamp_ = timestamp; size_ = size; numberFiles_ = numberFiles; app_metadata_ = app_metadata; } /** * * @return the backup id. */ public int backupId() { return backupId_; } /** * * @return the timestamp of the backup. */ public long timestamp() { return timestamp_; } /** * * @return the size of the backup */ public long size() { return size_; } /** * * @return the number of files of this backup. */ public int numberFiles() { return numberFiles_; } /** * * @return the associated application metadata, or null */ public String appMetadata() { return app_metadata_; } private int backupId_; private long timestamp_; private long size_; private int numberFiles_; private String app_metadata_; }
9244e572658f48950280ea4a9d6c080a5f516732
12,303
java
Java
app/src/main/java/com/moxi/agenttool/ui/main/fragment/HomeFragment.java
subenli115/AgentTool
63ef76b0ce390331d7cdb863a6391920bc682fb9
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/moxi/agenttool/ui/main/fragment/HomeFragment.java
subenli115/AgentTool
63ef76b0ce390331d7cdb863a6391920bc682fb9
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/moxi/agenttool/ui/main/fragment/HomeFragment.java
subenli115/AgentTool
63ef76b0ce390331d7cdb863a6391920bc682fb9
[ "Apache-2.0" ]
null
null
null
39.559486
143
0.573762
1,003,180
package com.moxi.agenttool.ui.main.fragment; import android.content.Context; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebSettings; import androidx.lifecycle.Observer; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.moxi.agenttool.BR; import com.moxi.agenttool.R; import com.moxi.agenttool.contract.AppConstans; import com.moxi.agenttool.databinding.FragmentHomeBinding; import com.moxi.agenttool.livedatas.LiveDataBus; import com.moxi.agenttool.ui.base.fragment.BaseFragment; import com.moxi.agenttool.ui.bean.FilterHouseBean; import com.moxi.agenttool.ui.bean.FilterHouseResult; import com.moxi.agenttool.ui.bean.House; import com.moxi.agenttool.ui.bean.ImportantBean; import com.moxi.agenttool.ui.bean.KeynoteClientBean; import com.moxi.agenttool.ui.login.LoginActivity; import com.moxi.agenttool.ui.main.activity.MatchingActivity; import com.moxi.agenttool.ui.main.viewmodel.MainViewModel; import com.moxi.agenttool.utils.MatchUtils; import com.moxi.agenttool.utils.PreferenceManager; import com.moxi.agenttool.wdiget.MyRefreshLottieHeader; import com.scwang.smartrefresh.layout.api.RefreshHeader; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @ClassName: homeFragment * @Description: java类作用描述 * @Author: join_lu * @CreateDate: 2021/7/21 11:43 */ public class HomeFragment extends BaseFragment<FragmentHomeBinding, MainViewModel> implements OnRefreshLoadMoreListener, View.OnClickListener { private Context context; private MyRefreshLottieHeader mRefreshLottieHeader; private String beikeURlWithLocation; private List<FilterHouseBean> list = new ArrayList<>(); //创建基本线程池 static ExecutorService threadPoolExecutor = Executors.newSingleThreadExecutor(); private Document document; private Timer timer; private Timer timer1; private List<FilterHouseResult.DataDTO> dataDTOList; private boolean currentUserIsLogin; @Override public int initContentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return R.layout.fragment_home; } @Override public int initVariableId() { return BR.viewModel; } @Override public void initData() { context = getContext(); binding.tvClick.setOnClickListener(this); /** *字体设置 */ //设置 Header 为 贝塞尔雷达 样式 currentUserIsLogin = PreferenceManager.getInstance().getCurrentUserIsLogin(); mRefreshLottieHeader = new MyRefreshLottieHeader(context); setHeader(mRefreshLottieHeader); binding.refreshLayout.setEnableLoadMore(false); binding.refreshLayout.setOnRefreshLoadMoreListener(this); viewModel.getKeyCustomers(); binding.tvNum.setText("0"); binding.rtv.setText("0"); WebSettings webSettings = binding.webView.getSettings(); // 设置允许JS弹窗 webSettings.setJavaScriptCanOpenWindowsAutomatically(true); binding.webView.getSettings().setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true); binding.webView.loadUrl("file:///android_asset/occalljs.html"); timer = new Timer(); timer1 = new Timer(); } public void getHouseList(final String beikeURlWithLocation, final KeynoteClientBean keyData) { final String BeiKeUrl = "https://cq.fang.ke.com"; parseDocument(beikeURlWithLocation, keyData, BeiKeUrl); } private void parseDocument(final String beikeURlWithLocation, final KeynoteClientBean keyData, final String beiKeUrl) { new Thread(new Runnable() { @Override public void run() { String url = beikeURlWithLocation; try { document = Jsoup.connect(url).get(); Log.d("TTTT", "jsoup:" + document); // TODO Auto-generated method stub Elements elementsByClass = document.getElementsByClass("resblock-have-find"); String value = elementsByClass.get(0).getElementsByClass("value").get(0).text(); int resultCount = Integer.parseInt(value); Elements lis = document.getElementsByClass("resblock-list post_ulog_exposure_scroll has-results"); int n = 0; if (resultCount >= 6) { n = 6; } else { n = lis.size(); } Log.e("n数量", "n数量" + n + "id" + keyData.getNum()); Log.e("keyData", "" + keyData.getNum()); ArrayList<House> houses = new ArrayList<>(); houses.clear(); if (lis.size() > 0) { for (int i = 0; i < n; i++) { House house = new House(); Element li = lis.get(i); Element locationA = li.getElementsByClass("resblock-location").get(0); Element imgA = li.getElementsByClass("resblock-img-wrapper").get(0); String imgUrl = imgA.getElementsByTag("img").get(0).attr("data-original"); Element houseA = li.getElementsByClass("resblock-room").get(0); String locationStr = locationA.text(); String href = imgA.attr("href"); String title = imgA.attr("title"); String detailUrl = beiKeUrl + href; // 楼盘户型 String houseType = ""; Elements spans = houseA.getElementsByTag("span"); for (int j = 0; j < spans.size(); j++) { Element span = spans.get(j); if (!span.getClass().equals("area")) { houseType = houseType + span.text(); } } // 房屋面积 String houseArea = ""; if (houseA.getElementsByClass("area").size() == 1) { houseArea = houseA.getElementsByClass("area").get(0).text(); } // 楼盘单价 String priceStr = li.getElementsByClass("number").get(0).text(); String priceDesc = ""; if (li.getElementsByClass("desc").size() == 1) { priceDesc = li.getElementsByClass("desc").get(0).text(); } // 楼盘总价 String priceSecond = ""; if (li.getElementsByClass("second").size() == 1) { priceSecond = li.getElementsByClass("second").get(0).text(); } house.setArea(houseArea); house.setDetailUrl(detailUrl); house.setImgUrl(imgUrl); house.setName(title); house.setLocation(locationStr); house.setPriceFirst(priceStr + priceDesc); house.setPriceSecond(priceSecond); house.setType(houseType); Log.e("househouse", "" + house); houses.add(house); } FilterHouseBean filterHouseBean = new FilterHouseBean(); ImportantBean.DataDTO dataDTO = keyData.getDataDTO(); filterHouseBean.setHouseList(houses); filterHouseBean.setClientId(keyData.getDataDTO().getId()); filterHouseBean.setClientUpdateTime(dataDTO.getCreateTime()); filterHouseBean.setArea(dataDTO.getArea()); filterHouseBean.setAvatar(dataDTO.getAvatar()); filterHouseBean.setCity(dataDTO.getCity()); filterHouseBean.setCreateTime(dataDTO.getCreateTime()); filterHouseBean.setIsprivatephone(dataDTO.getIsprivatephone()); filterHouseBean.setName(dataDTO.getName()); filterHouseBean.setPhone(dataDTO.getPhone()); filterHouseBean.setRemark(dataDTO.getRemark()); filterHouseBean.setSex(dataDTO.getSex()); list.add(filterHouseBean); Log.e("keylist", "" + list.size()); }else { Log.e("keyData", "" + keyData.getNum()); } Log.e("keyData1", "" + keyData.getNum()); } catch (Exception interruptedException) { interruptedException.printStackTrace(); } } }).start(); } static int count = 0; //循环计数器 @Override public void initViewObservable() { viewModel.importTrantMutableLiveData.observe(this, new Observer<List<ImportantBean.DataDTO>>() { @Override public void onChanged(final List<ImportantBean.DataDTO> dataDTOS) { MatchUtils.getMatchData(dataDTOS,viewModel); } }); viewModel.filterHouseResultMutableLiveData.observe(this, new Observer<List<FilterHouseResult.DataDTO>>() { @Override public void onChanged(List<FilterHouseResult.DataDTO> dataDTOS) { dataDTOList = dataDTOS; binding.refreshLayout.finishRefresh(true);//传入false表示刷新失败 LiveDataBus.get().with(AppConstans.BusTag.ADDBEAN).setValue(dataDTOList); } }); viewModel.filterSize.observe(this, new Observer<Integer>() { @Override public void onChanged(Integer integer) { Log.e("filterSize", "" + integer.toString()); binding.tvNum.setText(integer + ""); binding.rtv.setText(integer + ""); } }); } @Override public void onLoadMore(RefreshLayout refreshLayout) { } /** * @author nineday */ public class SubThread extends Thread { private final int i; private KeynoteClientBean keynoteClientBean; public SubThread(int i, KeynoteClientBean keynoteClientBean) { this.i = i; this.keynoteClientBean = keynoteClientBean; } @Override public void run() { getHouseList(beikeURlWithLocation, keynoteClientBean); } } public static String object2json(Object obj) { Gson gson = new GsonBuilder().disableHtmlEscaping().create(); return gson.toJson(obj); } public List<FilterHouseResult.DataDTO> getDataDTOList() { return dataDTOList; } /** * 设置刷新header风格 * * @param header */ private void setHeader(RefreshHeader header) { if (binding.refreshLayout.isRefreshing()) { binding.refreshLayout.finishRefresh(); } binding.refreshLayout.setRefreshHeader(header); } @Override public void onClick(View v) { if(currentUserIsLogin){ MatchingActivity.actionStart(context, dataDTOList); }else { LoginActivity.actionStart(getActivity()); } } @Override public void onRefresh(RefreshLayout refreshLayout) { Log.e("onRefresh", "onRefresh"); list.clear(); viewModel.getKeyCustomers(); } @Override public void reload() { } }
9244e79ef0d9e0913516920fc245be35410c875a
1,777
java
Java
ipfs-common/src/main/java/com/github/doobo/utils/SmUtils.java
doobo/ipfs-cloud
f66c6dae505e9f6a7f8a6ef8fa325471c30c2d7d
[ "Apache-2.0" ]
15
2020-07-23T01:54:00.000Z
2022-02-23T00:49:41.000Z
ipfs-common/src/main/java/com/github/doobo/utils/SmUtils.java
doobo/ipfs-cloud
f66c6dae505e9f6a7f8a6ef8fa325471c30c2d7d
[ "Apache-2.0" ]
1
2020-10-31T12:25:23.000Z
2020-12-18T03:01:38.000Z
ipfs-common/src/main/java/com/github/doobo/utils/SmUtils.java
doobo/ipfs-cloud
f66c6dae505e9f6a7f8a6ef8fa325471c30c2d7d
[ "Apache-2.0" ]
7
2020-07-23T01:54:19.000Z
2021-12-21T13:23:24.000Z
22.493671
81
0.705684
1,003,181
package com.github.doobo.utils; import cn.hutool.crypto.BCUtil; import cn.hutool.crypto.SmUtil; import cn.hutool.crypto.asymmetric.KeyType; import cn.hutool.crypto.asymmetric.SM2; import org.bouncycastle.crypto.params.ECPrivateKeyParameters; import java.security.PublicKey; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * SM基础工具 */ public class SmUtils { private static final Map<String, SM2> SM2S = new ConcurrentHashMap<>(); /** * SM2编码 */ public static String encryptBySM2(String publicKey, String rec){ if(publicKey == null || publicKey.isEmpty()){ return null; } return getSm2ByPublicKeyCache(publicKey).encryptHex(rec, KeyType.PublicKey); } /** * SM2编码 */ public static String decryptBySM2(String privateKey, String rec){ if(privateKey == null || privateKey.isEmpty()){ return null; } return getSm2ByPrivateKeyCache(privateKey).decryptStr(rec, KeyType.PrivateKey); } /** * 缓存获取SM2 */ public static SM2 getSm2ByPublicKeyCache(String publicKey){ SM2 sm2; if(SM2S.containsKey(publicKey)){ sm2 = SM2S.get(publicKey); }else{ if(SM2S.size() > 100){ SM2S.clear(); } PublicKey v1 = BCUtil.decodeECPoint(publicKey, "sm2p256v1"); sm2 = SmUtil.sm2(); sm2.setPublicKey(v1); sm2.usePlainEncoding(); SM2S.put(publicKey, sm2); } return sm2; } /** * 缓存获取SM2 */ public static SM2 getSm2ByPrivateKeyCache(String privateKey){ SM2 sm2; if(SM2S.containsKey(privateKey)){ sm2 = SM2S.get(privateKey); }else{ if(SM2S.size() > 100){ SM2S.clear(); } ECPrivateKeyParameters privateKeyParameters = BCUtil.toSm2Params(privateKey); sm2 = new SM2(privateKeyParameters, null); sm2.usePlainEncoding(); SM2S.put(privateKey, sm2); } return sm2; } }
9244e8083be2293ba9c215e0bea2edf9b65bf87f
56
java
Java
src/main/java/messages/ChangeMessages.java
KAIQIANG-LIU/fastcx
1f0e9012da5e064bcc0085f8161a0acec3d0f381
[ "MIT" ]
null
null
null
src/main/java/messages/ChangeMessages.java
KAIQIANG-LIU/fastcx
1f0e9012da5e064bcc0085f8161a0acec3d0f381
[ "MIT" ]
null
null
null
src/main/java/messages/ChangeMessages.java
KAIQIANG-LIU/fastcx
1f0e9012da5e064bcc0085f8161a0acec3d0f381
[ "MIT" ]
null
null
null
9.333333
29
0.696429
1,003,182
package messages; public enum ChangeMessages { }
9244e889f92f453f22519a8c58a6401f9e146a60
7,551
java
Java
erp_ejb/src_inventario/com/bydan/erp/inventario/util/ProductoCuentaContableParameterReturnGeneral.java
bydan/pre
54674f4dcffcac5dbf458cdf57a4c69fde5c55ff
[ "Apache-2.0" ]
null
null
null
erp_ejb/src_inventario/com/bydan/erp/inventario/util/ProductoCuentaContableParameterReturnGeneral.java
bydan/pre
54674f4dcffcac5dbf458cdf57a4c69fde5c55ff
[ "Apache-2.0" ]
null
null
null
erp_ejb/src_inventario/com/bydan/erp/inventario/util/ProductoCuentaContableParameterReturnGeneral.java
bydan/pre
54674f4dcffcac5dbf458cdf57a4c69fde5c55ff
[ "Apache-2.0" ]
null
null
null
37.755
128
0.816978
1,003,183
/* *AVISO LEGAL © Copyright *Este programa esta protegido por la ley de derechos de autor. *La reproduccion o distribucion ilicita de este programa o de cualquiera de *sus partes esta penado por la ley con severas sanciones civiles y penales, *y seran objeto de todas las sanciones legales que correspondan. *Su contenido no puede copiarse para fines comerciales o de otras, *ni puede mostrarse, incluso en una version modificada, en otros sitios Web. Solo esta permitido colocar hipervinculos al sitio web. */ package com.bydan.erp.inventario.util; import java.util.Set; import java.util.HashSet; import java.util.ArrayList; import java.util.List; import java.io.Serializable; import java.util.Date; import java.sql.Timestamp; import org.hibernate.validator.*; import com.bydan.framework.erp.business.entity.GeneralEntity; import com.bydan.framework.erp.business.entity.GeneralEntityParameterReturnGeneral; import com.bydan.framework.erp.business.entity.GeneralEntityReturnGeneral; import com.bydan.framework.erp.business.entity.Classe; import com.bydan.framework.erp.business.dataaccess.ConstantesSql; //import com.bydan.framework.erp.business.entity.Mensajes; import com.bydan.framework.erp.util.Constantes; import com.bydan.framework.erp.util.DeepLoadType; import com.bydan.erp.inventario.util.ProductoCuentaContableConstantesFunciones; import com.bydan.erp.inventario.business.entity.*;//ProductoCuentaContable import com.bydan.erp.seguridad.business.entity.*; import com.bydan.erp.contabilidad.business.entity.*; @SuppressWarnings("unused") public class ProductoCuentaContableParameterReturnGeneral extends GeneralEntityParameterReturnGeneral implements Serializable { private static final long serialVersionUID=1L; protected ProductoCuentaContable productocuentacontable; protected List<ProductoCuentaContable> productocuentacontables; public List<Empresa> empresasForeignKey; public List<Sucursal> sucursalsForeignKey; public List<Bodega> bodegasForeignKey; public List<Producto> productosForeignKey; public List<CentroCosto> centrocostosForeignKey; public List<CuentaContable> cuentacontableinventariosForeignKey; public List<CuentaContable> cuentacontablecostosForeignKey; public List<CuentaContable> cuentacontableventasForeignKey; public List<CuentaContable> cuentacontabledescuentosForeignKey; public List<CuentaContable> cuentacontabledevolucionsForeignKey; public List<CuentaContable> cuentacontabledebitosForeignKey; public List<CuentaContable> cuentacontablecreditosForeignKey; public ProductoCuentaContableParameterReturnGeneral () throws Exception { super(); this.productocuentacontables= new ArrayList<ProductoCuentaContable>(); this.productocuentacontable= new ProductoCuentaContable(); this.empresasForeignKey=new ArrayList<Empresa>(); this.sucursalsForeignKey=new ArrayList<Sucursal>(); this.bodegasForeignKey=new ArrayList<Bodega>(); this.productosForeignKey=new ArrayList<Producto>(); this.centrocostosForeignKey=new ArrayList<CentroCosto>(); this.cuentacontableinventariosForeignKey=new ArrayList<CuentaContable>(); this.cuentacontablecostosForeignKey=new ArrayList<CuentaContable>(); this.cuentacontableventasForeignKey=new ArrayList<CuentaContable>(); this.cuentacontabledescuentosForeignKey=new ArrayList<CuentaContable>(); this.cuentacontabledevolucionsForeignKey=new ArrayList<CuentaContable>(); this.cuentacontabledebitosForeignKey=new ArrayList<CuentaContable>(); this.cuentacontablecreditosForeignKey=new ArrayList<CuentaContable>(); } public ProductoCuentaContable getProductoCuentaContable() throws Exception { return productocuentacontable; } public void setProductoCuentaContable(ProductoCuentaContable newProductoCuentaContable) { this.productocuentacontable = newProductoCuentaContable; } public List<ProductoCuentaContable> getProductoCuentaContables() throws Exception { return productocuentacontables; } public void setProductoCuentaContables(List<ProductoCuentaContable> newProductoCuentaContables) { this.productocuentacontables = newProductoCuentaContables; } public List<Empresa> getempresasForeignKey() { return this.empresasForeignKey; } public List<Sucursal> getsucursalsForeignKey() { return this.sucursalsForeignKey; } public List<Bodega> getbodegasForeignKey() { return this.bodegasForeignKey; } public List<Producto> getproductosForeignKey() { return this.productosForeignKey; } public List<CentroCosto> getcentrocostosForeignKey() { return this.centrocostosForeignKey; } public List<CuentaContable> getcuentacontableinventariosForeignKey() { return this.cuentacontableinventariosForeignKey; } public List<CuentaContable> getcuentacontablecostosForeignKey() { return this.cuentacontablecostosForeignKey; } public List<CuentaContable> getcuentacontableventasForeignKey() { return this.cuentacontableventasForeignKey; } public List<CuentaContable> getcuentacontabledescuentosForeignKey() { return this.cuentacontabledescuentosForeignKey; } public List<CuentaContable> getcuentacontabledevolucionsForeignKey() { return this.cuentacontabledevolucionsForeignKey; } public List<CuentaContable> getcuentacontabledebitosForeignKey() { return this.cuentacontabledebitosForeignKey; } public List<CuentaContable> getcuentacontablecreditosForeignKey() { return this.cuentacontablecreditosForeignKey; } public void setempresasForeignKey(List<Empresa> empresasForeignKey) { this.empresasForeignKey=empresasForeignKey; } public void setsucursalsForeignKey(List<Sucursal> sucursalsForeignKey) { this.sucursalsForeignKey=sucursalsForeignKey; } public void setbodegasForeignKey(List<Bodega> bodegasForeignKey) { this.bodegasForeignKey=bodegasForeignKey; } public void setproductosForeignKey(List<Producto> productosForeignKey) { this.productosForeignKey=productosForeignKey; } public void setcentrocostosForeignKey(List<CentroCosto> centrocostosForeignKey) { this.centrocostosForeignKey=centrocostosForeignKey; } public void setcuentacontableinventariosForeignKey(List<CuentaContable> cuentacontableinventariosForeignKey) { this.cuentacontableinventariosForeignKey=cuentacontableinventariosForeignKey; } public void setcuentacontablecostosForeignKey(List<CuentaContable> cuentacontablecostosForeignKey) { this.cuentacontablecostosForeignKey=cuentacontablecostosForeignKey; } public void setcuentacontableventasForeignKey(List<CuentaContable> cuentacontableventasForeignKey) { this.cuentacontableventasForeignKey=cuentacontableventasForeignKey; } public void setcuentacontabledescuentosForeignKey(List<CuentaContable> cuentacontabledescuentosForeignKey) { this.cuentacontabledescuentosForeignKey=cuentacontabledescuentosForeignKey; } public void setcuentacontabledevolucionsForeignKey(List<CuentaContable> cuentacontabledevolucionsForeignKey) { this.cuentacontabledevolucionsForeignKey=cuentacontabledevolucionsForeignKey; } public void setcuentacontabledebitosForeignKey(List<CuentaContable> cuentacontabledebitosForeignKey) { this.cuentacontabledebitosForeignKey=cuentacontabledebitosForeignKey; } public void setcuentacontablecreditosForeignKey(List<CuentaContable> cuentacontablecreditosForeignKey) { this.cuentacontablecreditosForeignKey=cuentacontablecreditosForeignKey; } }
9244e8b1b256a74f61d96ef4baa9ac9e998ba289
1,086
java
Java
src/main/groovy/com/android/tools/internal/license/LicenseReportPlugin.java
HugeDevDen/platform_tools_buildSrc
8141afd9ae45978c5c3e70ed7e51470c33980821
[ "Apache-2.0" ]
null
null
null
src/main/groovy/com/android/tools/internal/license/LicenseReportPlugin.java
HugeDevDen/platform_tools_buildSrc
8141afd9ae45978c5c3e70ed7e51470c33980821
[ "Apache-2.0" ]
null
null
null
src/main/groovy/com/android/tools/internal/license/LicenseReportPlugin.java
HugeDevDen/platform_tools_buildSrc
8141afd9ae45978c5c3e70ed7e51470c33980821
[ "Apache-2.0" ]
null
null
null
33.9375
96
0.73849
1,003,184
/* * Copyright (C) 2018 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.tools.internal.license; import org.gradle.api.Plugin; import org.gradle.api.Project; /** * Plugin setting up the licenseReport task. */ public class LicenseReportPlugin implements Plugin<Project> { @Override public void apply(Project project) { ReportTask licenseReport = project.getTasks().create("licenseReport", ReportTask.class); licenseReport.dependsOn(project.getConfigurations().getByName("runtime")); } }
9244e98a4b7d3c0052e08a816566196b9947b947
3,171
java
Java
alert-common/src/main/java/com/synopsys/integration/alert/common/event/EventListenerConfigurer.java
vberegov/blackduck-alert
f5597257fd19d11c1b8041b214d780d0255dcda5
[ "Apache-2.0" ]
null
null
null
alert-common/src/main/java/com/synopsys/integration/alert/common/event/EventListenerConfigurer.java
vberegov/blackduck-alert
f5597257fd19d11c1b8041b214d780d0255dcda5
[ "Apache-2.0" ]
null
null
null
alert-common/src/main/java/com/synopsys/integration/alert/common/event/EventListenerConfigurer.java
vberegov/blackduck-alert
f5597257fd19d11c1b8041b214d780d0255dcda5
[ "Apache-2.0" ]
null
null
null
50.333333
176
0.81457
1,003,185
/* * alert-common * * Copyright (c) 2021 Synopsys, Inc. * * Use subject to the terms and conditions of the Synopsys End User Software License and Maintenance Agreement. All rights reserved worldwide. */ package com.synopsys.integration.alert.common.event; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.jms.annotation.JmsListenerConfigurer; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; import org.springframework.jms.config.JmsListenerEndpointRegistrar; import org.springframework.jms.config.SimpleJmsListenerEndpoint; @Configuration public class EventListenerConfigurer implements JmsListenerConfigurer { private final Logger logger = LoggerFactory.getLogger(EventListenerConfigurer.class); private final List<AlertChannelEventListener> alertChannelEventListeners; private final List<AlertDefaultEventListener> alertDefaultEventListeners; private final DefaultJmsListenerContainerFactory defaultJmsListenerContainerFactory; private final DefaultJmsListenerContainerFactory distributionChannelJmsListenerContainerFactory; @Autowired public EventListenerConfigurer(List<AlertChannelEventListener> alertChannelEventListeners, List<AlertDefaultEventListener> alertDefaultEventListeners, DefaultJmsListenerContainerFactory defaultJmsListenerContainerFactory, DefaultJmsListenerContainerFactory distributionChannelJmsListenerContainerFactory) { this.alertChannelEventListeners = alertChannelEventListeners; this.alertDefaultEventListeners = alertDefaultEventListeners; this.defaultJmsListenerContainerFactory = defaultJmsListenerContainerFactory; this.distributionChannelJmsListenerContainerFactory = distributionChannelJmsListenerContainerFactory; } @Override public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) { logger.info("Registering JMS Listeners"); alertDefaultEventListeners.forEach(listener -> registerListenerEndpoint(registrar, listener, defaultJmsListenerContainerFactory)); alertChannelEventListeners.forEach(listener -> registerListenerEndpoint(registrar, listener, distributionChannelJmsListenerContainerFactory)); } private void registerListenerEndpoint(JmsListenerEndpointRegistrar registrar, AlertEventListener listener, DefaultJmsListenerContainerFactory jmsListenerContainerFactory) { String destinationName = listener.getDestinationName(); String listenerId = createListenerId(destinationName); logger.info("Registering JMS Listener: {}", listenerId); SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint(); endpoint.setId(listenerId); endpoint.setDestination(destinationName); endpoint.setMessageListener(listener); registrar.registerEndpoint(endpoint, jmsListenerContainerFactory); } private String createListenerId(String name) { return String.format("%sListener", name); } }
9244ec25a9d9445ac05a0f4622d0243a49e5767a
2,615
java
Java
jstarcraft-ai-math/src/main/java/com/jstarcraft/ai/math/algorithm/correlation/MathCorrelation.java
HongZhaoHua/jstarcraft-ai
fdab8bdf46d32a5c3d742db2c9211d438287dd8a
[ "Apache-2.0" ]
167
2019-04-22T04:50:24.000Z
2022-02-19T13:36:49.000Z
jstarcraft-ai-math/src/main/java/com/jstarcraft/ai/math/algorithm/correlation/MathCorrelation.java
HongZhaoHua/jstarcraft-ai
fdab8bdf46d32a5c3d742db2c9211d438287dd8a
[ "Apache-2.0" ]
2
2021-06-10T02:27:50.000Z
2022-01-21T23:23:43.000Z
jstarcraft-ai-math/src/main/java/com/jstarcraft/ai/math/algorithm/correlation/MathCorrelation.java
HongZhaoHua/jstarcraft-ai
fdab8bdf46d32a5c3d742db2c9211d438287dd8a
[ "Apache-2.0" ]
43
2019-04-22T12:31:44.000Z
2022-02-22T17:06:02.000Z
33.525641
132
0.572467
1,003,186
package com.jstarcraft.ai.math.algorithm.correlation; import java.util.concurrent.Semaphore; import com.jstarcraft.ai.environment.EnvironmentContext; import com.jstarcraft.ai.math.structure.matrix.MathMatrix; import com.jstarcraft.ai.math.structure.vector.MathVector; /** * 相关度 * * @author Birdy * */ public interface MathCorrelation { /** * 根据分数矩阵计算相关度 * * @param scoreMatrix * @param transpose * @param monitor */ default void calculateCoefficients(MathMatrix scoreMatrix, boolean transpose, CorrelationMonitor monitor) { EnvironmentContext context = EnvironmentContext.getContext(); Semaphore semaphore = new Semaphore(0); int count = transpose ? scoreMatrix.getColumnSize() : scoreMatrix.getRowSize(); for (int leftIndex = 0; leftIndex < count; leftIndex++) { MathVector thisVector = transpose ? scoreMatrix.getColumnVector(leftIndex) : scoreMatrix.getRowVector(leftIndex); if (thisVector.getElementSize() == 0) { continue; } monitor.notifyCoefficientCalculated(leftIndex, leftIndex, getIdentical()); // user/item itself exclusive int permits = 0; for (int rightIndex = leftIndex + 1; rightIndex < count; rightIndex++) { MathVector thatVector = transpose ? scoreMatrix.getColumnVector(rightIndex) : scoreMatrix.getRowVector(rightIndex); if (thatVector.getElementSize() == 0) { continue; } int leftCursor = leftIndex; int rightCursor = rightIndex; context.doAlgorithmByAny(leftIndex * rightIndex, () -> { float coefficient = getCoefficient(thisVector, thatVector); if (!Float.isNaN(coefficient)) { monitor.notifyCoefficientCalculated(leftCursor, rightCursor, coefficient); } semaphore.release(); }); permits++; } try { semaphore.acquire(permits); } catch (Exception exception) { throw new RuntimeException(exception); } } } /** * 获取两个向量的相关系数 * * @param leftVector * @param rightVector * @param scale * @return */ float getCoefficient(MathVector leftVector, MathVector rightVector); /** * 获取恒等系数 * * @return */ float getIdentical(); }
9244ecdfa29c6710dfe989140ded933181cb0e53
549,970
java
Java
elasticsearch/36884807b3cc9d660db4da062275c7fdbec8ba67/randoop_1/RegressionTest0.java
leusonmario/2022PhDThesis
22969dccdafbc02f022633e9b4c4346821da1402
[ "MIT" ]
null
null
null
elasticsearch/36884807b3cc9d660db4da062275c7fdbec8ba67/randoop_1/RegressionTest0.java
leusonmario/2022PhDThesis
22969dccdafbc02f022633e9b4c4346821da1402
[ "MIT" ]
null
null
null
elasticsearch/36884807b3cc9d660db4da062275c7fdbec8ba67/randoop_1/RegressionTest0.java
leusonmario/2022PhDThesis
22969dccdafbc02f022633e9b4c4346821da1402
[ "MIT" ]
null
null
null
61.829117
578
0.717532
1,003,187
import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class RegressionTest0 { public static boolean debug = false; @Test public void test00001() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00001"); org.apache.lucene.util.LuceneTestCase.overrideDefaultQueryCache(); } @Test public void test00002() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00002"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.TEST_CODEC; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "random" + "'", str0, "random"); } @Test public void test00003() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00003"); org.junit.Assert.assertNotNull((java.lang.Object) (-1.0d)); } @Test public void test00004() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00004"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy1 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00005() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00005"); boolean boolean0 = org.elasticsearch.test.ElasticsearchTestCase.checkIndexFailed; // flaky: org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00006() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00006"); // The following exception was thrown during execution in test generation try { short short0 = org.elasticsearch.test.ElasticsearchTestCase.randomShort(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00007() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00007"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path2 = org.apache.lucene.util.LuceneTestCase.createTempFile("hi!", "random"); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00008() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00008"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.MockDirectoryWrapper mockDirectoryWrapper1 = org.apache.lucene.util.LuceneTestCase.newMockDirectory(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00009() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00009"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.SYSPROP_NIGHTLY; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "tests.nightly" + "'", str0, "tests.nightly"); } @Test public void test00010() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00010"); java.util.Random random0 = null; org.apache.lucene.index.LiveIndexWriterConfig liveIndexWriterConfig1 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.maybeChangeLiveIndexWriterConfig(random0, liveIndexWriterConfig1); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00011() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00011"); org.apache.lucene.index.IndexReader indexReader0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.IndexReader indexReader1 = org.apache.lucene.util.LuceneTestCase.wrapReader(indexReader0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00012() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00012"); java.nio.file.Path path0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.BaseDirectoryWrapper baseDirectoryWrapper1 = org.apache.lucene.util.LuceneTestCase.newFSDirectory(path0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00013() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00013"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.AlcoholicMergePolicy alcoholicMergePolicy0 = org.apache.lucene.util.LuceneTestCase.newAlcoholicMergePolicy(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00014() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00014"); org.apache.lucene.util.LuceneTestCase.restoreCPUCoreCount(); } @Test public void test00015() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00015"); // The following exception was thrown during execution in test generation try { boolean boolean0 = org.apache.lucene.util.LuceneTestCase.usually(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00016() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00016"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomRealisticUnicodeOfLength(100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00017() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00017"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy1 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(true); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00018() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00018"); java.util.Random random0 = null; org.apache.lucene.store.IOContext iOContext1 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.IOContext iOContext2 = org.apache.lucene.util.LuceneTestCase.newIOContext(random0, iOContext1); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00019() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00019"); // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.assumeFalse("", true); org.junit.Assert.fail("Expected exception of type com.carrotsearch.randomizedtesting.InternalAssumptionViolatedException; message: failed assumption"); } catch (org.junit.internal.AssumptionViolatedException e) { // Expected exception. } } @Test public void test00020() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00020"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.TEST_AWAITSFIX; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00021() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00021"); org.elasticsearch.Version version0 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.common.settings.ImmutableSettings.Builder builder1 = org.elasticsearch.test.ElasticsearchTestCase.settings(version0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00022() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00022"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfCodepointLengthBetween((-1), (int) (short) 1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00023() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00023"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.BaseDirectoryWrapper baseDirectoryWrapper1 = org.apache.lucene.util.LuceneTestCase.newDirectory(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00024() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00024"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.SYSPROP_FAILFAST; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "tests.failfast" + "'", str0, "tests.failfast"); } @Test public void test00025() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00025"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path0 = org.apache.lucene.util.LuceneTestCase.getBaseTempDirForTestClass(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00026() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00026"); java.nio.file.Path path0 = null; org.apache.lucene.store.LockFactory lockFactory1 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.BaseDirectoryWrapper baseDirectoryWrapper2 = org.apache.lucene.util.LuceneTestCase.newFSDirectory(path0, lockFactory1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00027() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00027"); // The following exception was thrown during execution in test generation try { org.elasticsearch.test.ElasticsearchTestCase.setFileSystem(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00028() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00028"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.TEST_DOCVALUESFORMAT; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "random" + "'", str0, "random"); } @Test public void test00029() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00029"); org.apache.lucene.analysis.Analyzer analyzer0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.IndexWriterConfig indexWriterConfig1 = org.apache.lucene.util.LuceneTestCase.newIndexWriterConfig(analyzer0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00030() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00030"); // The following exception was thrown during execution in test generation try { boolean boolean0 = org.apache.lucene.util.LuceneTestCase.rarely(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00031() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00031"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.TEST_NIGHTLY; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00032() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00032"); org.elasticsearch.test.ElasticsearchSingleNodeTest.tearDownClass(); } @Test public void test00033() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00033"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomAsciiOfLength((int) (short) -1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00034() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00034"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy2 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(false, (int) (byte) 10); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00035() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00035"); org.elasticsearch.test.ElasticsearchTestCase.restoreFileSystem(); } @Test public void test00036() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00036"); // The following exception was thrown during execution in test generation try { org.elasticsearch.test.ElasticsearchTestCase.setContentType(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00037() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00037"); // The following exception was thrown during execution in test generation try { java.util.Random random0 = org.apache.lucene.util.LuceneTestCase.random(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00038() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00038"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomAsciiOfLength((int) (short) 10); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00039() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00039"); // The following exception was thrown during execution in test generation try { boolean boolean0 = org.elasticsearch.test.ElasticsearchTestCase.randomBoolean(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00040() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00040"); // The following exception was thrown during execution in test generation try { boolean boolean0 = org.elasticsearch.test.ElasticsearchTestCase.frequently(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00041() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00041"); // The following exception was thrown during execution in test generation try { float float0 = org.elasticsearch.test.ElasticsearchTestCase.randomFloat(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00042() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00042"); // The following exception was thrown during execution in test generation try { java.lang.String[] strArray3 = org.elasticsearch.test.ElasticsearchTestCase.generateRandomStringArray(1, (int) (byte) 0, true); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00043() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00043"); // The following exception was thrown during execution in test generation try { int int1 = org.apache.lucene.util.LuceneTestCase.atLeast((int) (byte) 100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00044() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00044"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomAsciiOfLength(100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00045() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00045"); java.text.Collator collator0 = null; // The following exception was thrown during execution in test generation try { int int3 = org.apache.lucene.util.LuceneTestCase.collate(collator0, "tests.failfast", "random"); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00046() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00046"); // The following exception was thrown during execution in test generation try { java.lang.Class<?> wildcardClass0 = org.apache.lucene.util.LuceneTestCase.getTestClass(); org.junit.Assert.fail("Expected exception of type java.lang.RuntimeException; message: The rule is not currently executing."); } catch (java.lang.RuntimeException e) { // Expected exception. } } @Test public void test00047() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00047"); org.apache.lucene.index.IndexReader indexReader0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.search.IndexSearcher indexSearcher2 = org.apache.lucene.util.LuceneTestCase.newSearcher(indexReader0, false); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00048() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00048"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.TEST_ASSERTS_ENABLED; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + true + "'", boolean0 == true); } @Test public void test00049() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00049"); org.junit.Assert.assertEquals("tests.nightly", (double) 0.0f, (double) 1L, 10.0d); } @Test public void test00050() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00050"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.SYSPROP_AWAITSFIX; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "tests.awaitsfix" + "'", str0, "tests.awaitsfix"); } @Test public void test00051() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00051"); org.junit.Assert.assertFalse(false); } @Test public void test00052() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00052"); // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.setupCPUCoreCount(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00053() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00053"); org.apache.lucene.store.Directory directory0 = null; // The following exception was thrown during execution in test generation try { boolean boolean2 = org.apache.lucene.util.LuceneTestCase.slowFileExists(directory0, ""); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00054() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00054"); // The following exception was thrown during execution in test generation try { java.util.Random random0 = org.elasticsearch.test.ElasticsearchTestCase.getRandom(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00055() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00055"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.SYSPROP_BADAPPLES; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "tests.badapples" + "'", str0, "tests.badapples"); } @Test public void test00056() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00056"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomAsciiOfLength((int) '#'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00057() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00057"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy1 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy((int) (short) 1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00058() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00058"); // The following exception was thrown during execution in test generation try { int int0 = org.elasticsearch.test.ElasticsearchTestCase.randomInt(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00059() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00059"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.VERBOSE; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00060() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00060"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { int int2 = org.apache.lucene.util.LuceneTestCase.atLeast(random0, 10); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00061() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00061"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.randomIntBetween((int) ' ', 1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00062() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00062"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomRealisticUnicodeOfCodepointLengthBetween(10, (int) (short) 100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00063() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00063"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.randomIntBetween((int) (short) 1, (int) (byte) 1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00064() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00064"); java.util.Random random0 = null; java.util.TimeZone timeZone1 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.AlcoholicMergePolicy alcoholicMergePolicy2 = org.apache.lucene.util.LuceneTestCase.newAlcoholicMergePolicy(random0, timeZone1); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00065() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00065"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy0 = org.apache.lucene.util.LuceneTestCase.newMergePolicy(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00066() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00066"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.IOContext iOContext1 = org.apache.lucene.util.LuceneTestCase.newIOContext(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00067() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00067"); // The following exception was thrown during execution in test generation try { int int1 = org.apache.lucene.util.LuceneTestCase.atLeast(10); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00068() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00068"); // The following exception was thrown during execution in test generation try { byte byte0 = org.elasticsearch.test.ElasticsearchTestCase.randomByte(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00069() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00069"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.scaledRandomIntBetween((int) ' ', (int) (short) 1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalArgumentException; message: max must be >= min: 32, 1"); } catch (java.lang.IllegalArgumentException e) { // Expected exception. } } @Test public void test00070() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00070"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.randomIntBetween(100, (int) (byte) 100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00071() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00071"); java.util.Random random0 = null; org.apache.lucene.document.Field.Store store3 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field4 = org.apache.lucene.util.LuceneTestCase.newStringField(random0, "tests.nightly", "tests.nightly", store3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00072() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00072"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfLength((int) (short) 1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00073() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00073"); java.lang.Object[] objArray5 = new java.lang.Object[] { (byte) -1, 1L, (short) -1, (-1L), 0.0f }; // The following exception was thrown during execution in test generation try { java.lang.Object obj6 = org.elasticsearch.test.ElasticsearchTestCase.randomFrom(objArray5); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } org.junit.Assert.assertNotNull(objArray5); org.junit.Assert.assertEquals(java.util.Arrays.deepToString(objArray5), "[-1, 1, -1, -1, 0.0]"); org.junit.Assert.assertEquals(java.util.Arrays.toString(objArray5), "[-1, 1, -1, -1, 0.0]"); } @Test public void test00074() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00074"); java.lang.String str0 = org.elasticsearch.test.ElasticsearchSingleNodeTest.nodeName(); org.junit.Assert.assertEquals("'" + str0 + "' != '" + "node_s_0" + "'", str0, "node_s_0"); } @Test public void test00075() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00075"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.TEST_POSTINGSFORMAT; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "random" + "'", str0, "random"); } @Test public void test00076() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00076"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.LogMergePolicy logMergePolicy0 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00077() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00077"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { boolean boolean1 = org.apache.lucene.util.LuceneTestCase.usually(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00078() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00078"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.randomIntBetween(1, (int) '4'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00079() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00079"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy1 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy((int) '#'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00080() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00080"); // The following exception was thrown during execution in test generation try { int int1 = org.elasticsearch.test.ElasticsearchTestCase.randomInt((int) '4'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00081() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00081"); java.util.Random random0 = null; org.apache.lucene.document.Field.Store store3 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field4 = org.apache.lucene.util.LuceneTestCase.newStringField(random0, "random", "tests.badapples", store3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00082() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00082"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy2 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(true, (int) '4'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00083() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00083"); // The following exception was thrown during execution in test generation try { org.apache.lucene.store.BaseDirectoryWrapper baseDirectoryWrapper0 = org.apache.lucene.util.LuceneTestCase.newDirectory(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00084() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00084"); org.elasticsearch.test.ElasticsearchTestCase.checkIndexFailed = false; } @Test public void test00085() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00085"); org.junit.Assert.assertEquals("tests.nightly", (java.lang.Object) "tests.badapples", (java.lang.Object) "tests.badapples"); } @Test public void test00086() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00086"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomRealisticUnicodeOfLengthBetween(1, (int) '4'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00087() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00087"); // The following exception was thrown during execution in test generation try { int int1 = org.apache.lucene.util.LuceneTestCase.atLeast((int) (byte) -1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00088() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00088"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.TEST_WEEKLY; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00089() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00089"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.TieredMergePolicy tieredMergePolicy0 = org.apache.lucene.util.LuceneTestCase.newTieredMergePolicy(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00090() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00090"); // The following exception was thrown during execution in test generation try { org.elasticsearch.test.ElasticsearchSingleNodeTest.setUpClass(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00091() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00091"); java.lang.String[] strArray2 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet3 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray2); java.lang.String[] strArray6 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet7 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray6); java.lang.String[] strArray10 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet11 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray10); java.util.Set[] setArray13 = new java.util.Set[3]; @SuppressWarnings("unchecked") java.util.Set<java.lang.Comparable<java.lang.String>>[] strComparableSetArray14 = (java.util.Set<java.lang.Comparable<java.lang.String>>[]) setArray13; strComparableSetArray14[0] = strComparableSet3; strComparableSetArray14[1] = strComparableSet7; strComparableSetArray14[2] = strComparableSet11; // The following exception was thrown during execution in test generation try { java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet21 = org.elasticsearch.test.ElasticsearchTestCase.randomFrom(strComparableSetArray14); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } org.junit.Assert.assertNotNull(strArray2); org.junit.Assert.assertNotNull(strComparableSet3); org.junit.Assert.assertNotNull(strArray6); org.junit.Assert.assertNotNull(strComparableSet7); org.junit.Assert.assertNotNull(strArray10); org.junit.Assert.assertNotNull(strComparableSet11); org.junit.Assert.assertNotNull(setArray13); org.junit.Assert.assertNotNull(strComparableSetArray14); } @Test public void test00092() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00092"); org.elasticsearch.test.ElasticsearchTestCase.restoreDefaultExceptionHandler(); } @Test public void test00093() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00093"); org.junit.Assert.assertNotSame("tests.nightly", (java.lang.Object) "tests.awaitsfix", (java.lang.Object) true); } @Test public void test00094() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00094"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.scaledRandomIntBetween((int) (short) 0, 0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00095() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00095"); org.apache.lucene.index.DirectoryReader directoryReader0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.SegmentReader segmentReader1 = org.apache.lucene.util.LuceneTestCase.getOnlySegmentReader(directoryReader0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00096() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00096"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path1 = org.apache.lucene.util.LuceneTestCase.createTempDir("tests.failfast"); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00097() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00097"); // The following exception was thrown during execution in test generation try { int int1 = org.elasticsearch.test.ElasticsearchTestCase.randomInt((int) (short) 0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00098() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00098"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.JENKINS_LARGE_LINE_DOCS_FILE; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "enwiki.random.lines.txt" + "'", str0, "enwiki.random.lines.txt"); } @Test public void test00099() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00099"); java.lang.String[] strArray2 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet3 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray2); // The following exception was thrown during execution in test generation try { java.lang.Comparable<java.lang.String> strComparable4 = org.elasticsearch.test.ElasticsearchTestCase.randomFrom((java.lang.Comparable<java.lang.String>[]) strArray2); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } org.junit.Assert.assertNotNull(strArray2); org.junit.Assert.assertNotNull(strComparableSet3); } @Test public void test00100() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00100"); org.apache.lucene.index.IndexReader indexReader0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.IndexReader indexReader1 = org.apache.lucene.util.LuceneTestCase.maybeWrapReader(indexReader0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00101() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00101"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.INFOSTREAM; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00102() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00102"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy2 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(false, (int) (byte) 100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00103() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00103"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfCodepointLength((-1)); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00104() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00104"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.DEFAULT_LINE_DOCS_FILE; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "europarl.lines.txt.gz" + "'", str0, "europarl.lines.txt.gz"); } @Test public void test00105() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00105"); org.apache.lucene.document.Field.Store store2 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field3 = org.apache.lucene.util.LuceneTestCase.newStringField("tests.awaitsfix", "tests.badapples", store2); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00106() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00106"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path1 = org.apache.lucene.util.LuceneTestCase.createTempDir("tests.awaitsfix"); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00107() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00107"); // The following exception was thrown during execution in test generation try { org.apache.lucene.store.MockDirectoryWrapper mockDirectoryWrapper0 = org.apache.lucene.util.LuceneTestCase.newMockDirectory(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00108() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00108"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { java.util.TimeZone timeZone1 = org.apache.lucene.util.LuceneTestCase.randomTimeZone(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00109() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00109"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { boolean boolean1 = org.apache.lucene.util.LuceneTestCase.rarely(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00110() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00110"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.randomIntBetween((int) (short) 10, (int) ' '); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00111() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00111"); java.lang.Exception exception1 = null; org.apache.lucene.util.LuceneTestCase.assumeNoException("enwiki.random.lines.txt", exception1); } @Test public void test00112() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00112"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.IndexReader indexReader4 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldsEquals("europarl.lines.txt.gz", indexReader3, indexReader4); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00113() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00113"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFuzzyNumeric(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00114() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00114"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQueryBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix-with-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00115() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00115"); org.apache.lucene.index.IndexReader indexReader0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.search.IndexSearcher indexSearcher3 = org.apache.lucene.util.LuceneTestCase.newSearcher(indexReader0, false, true); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00116() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00116"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00117() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00117"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00118() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00118"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.scaledRandomIntBetween((int) ' ', 0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalArgumentException; message: max must be >= min: 32, 0"); } catch (java.lang.IllegalArgumentException e) { // Expected exception. } } @Test public void test00119() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00119"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00120() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00120"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilterNamed(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00121() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00121"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00122() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00122"); // The following exception was thrown during execution in test generation try { long long0 = org.elasticsearch.test.ElasticsearchTestCase.randomLong(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00123() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00123"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00124() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00124"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.elasticsearch.common.settings.Settings settings8 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.env.NodeEnvironment nodeEnvironment9 = simpleIndexQueryParserTests0.newNodeEnvironment(settings8); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00125() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00125"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); org.apache.lucene.index.IndexReader indexReader2 = null; org.apache.lucene.index.IndexReader indexReader3 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertDocValuesEquals("node_s_0", indexReader2, indexReader3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00126() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00126"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeNamedFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00127() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00127"); org.apache.lucene.document.FieldType fieldType2 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field3 = org.apache.lucene.util.LuceneTestCase.newField("random", "tests.nightly", fieldType2); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00128() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00128"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testEmptyBooleanQueryInsideFQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/fquery-with-empty-bool-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00129() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00129"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); org.apache.lucene.index.IndexReader indexReader2 = null; org.apache.lucene.index.IndexReader indexReader3 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertNormsEquals("hi!", indexReader2, indexReader3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00130() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00130"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfLength(0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00131() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00131"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00132() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00132"); // The following exception was thrown during execution in test generation try { org.elasticsearch.test.ElasticsearchTestCase.setProcessors(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00133() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00133"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testWildcardBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/wildcard-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00134() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00134"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00135() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00135"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-fields3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00136() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00136"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermNamedFilterQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/term-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00137() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00137"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00138() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00138"); java.util.Random random0 = null; org.apache.lucene.document.FieldType fieldType3 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field4 = org.apache.lucene.util.LuceneTestCase.newField(random0, "enwiki.random.lines.txt", (java.lang.Object) ' ', fieldType3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00139() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00139"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter6(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance6.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00140() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00140"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter12(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance12.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00141() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00141"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { java.lang.String[] strArray8 = simpleIndexQueryParserTests0.tmpPaths(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00142() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00142"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter8(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance8.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00143() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00143"); java.util.concurrent.ExecutorService executorService1 = null; java.util.concurrent.ExecutorService[] executorServiceArray2 = new java.util.concurrent.ExecutorService[] { executorService1 }; boolean boolean3 = org.elasticsearch.test.ElasticsearchTestCase.terminate(executorServiceArray2); java.io.PrintStream printStream4 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.dumpArray("tests.failfast", (java.lang.Object[]) executorServiceArray2, printStream4); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(executorServiceArray2); org.junit.Assert.assertTrue("'" + boolean3 + "' != '" + true + "'", boolean3 == true); } @Test public void test00144() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00144"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00145() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00145"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00146() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00146"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.apache.lucene.index.IndexReader indexReader9 = null; org.apache.lucene.index.IndexReader indexReader10 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertDeletedDocsEquals("hi!", indexReader9, indexReader10); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00147() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00147"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilter1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00148() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00148"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQuery3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/not-filter3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00149() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00149"); org.junit.Assert.assertNotSame((java.lang.Object) 10.0d, (java.lang.Object) 100.0d); } @Test public void test00150() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00150"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.IndexWriterConfig indexWriterConfig0 = org.apache.lucene.util.LuceneTestCase.newIndexWriterConfig(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00151() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00151"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFilteredQuery3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/filtered-query3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00152() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00152"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00153() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00153"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNamedRegexpFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00154() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00154"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanOrQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanOr.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00155() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00155"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonNamedFilter(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00156() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00156"); org.apache.lucene.store.Directory directory0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.BaseDirectoryWrapper baseDirectoryWrapper1 = org.apache.lucene.util.LuceneTestCase.newDirectory(directory0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00157() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00157"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMatchAll(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/matchAll.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00158() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00158"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.TEST_DIRECTORY; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "random" + "'", str0, "random"); } @Test public void test00159() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00159"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomRealisticUnicodeOfCodepointLengthBetween((int) ' ', (int) (byte) 1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00160() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00160"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixNamedFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00161() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00161"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/filtered-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00162() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00162"); org.junit.Assert.assertTrue("node_s_0", true); } @Test public void test00163() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00163"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexableField indexableField11 = null; org.apache.lucene.index.IndexableField indexableField12 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldEquals("europarl.lines.txt.gz", indexableField11, indexableField12); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00164() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00164"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path0 = org.apache.lucene.util.LuceneTestCase.createTempDir(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00165() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00165"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy1 = org.apache.lucene.util.LuceneTestCase.newMergePolicy(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00166() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00166"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNotQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanNot.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00167() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00167"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.LEAVE_TEMPORARY; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00168() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00168"); org.elasticsearch.test.ElasticsearchTestCase.restoreProcessors(); } @Test public void test00169() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00169"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00170() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00170"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00171() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00171"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.IndexReader indexReader12 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertNormsEquals("", indexReader11, indexReader12); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00172() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00172"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00173() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00173"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.TermsEnum termsEnum12 = null; org.apache.lucene.index.TermsEnum termsEnum13 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermsEnumEquals("tests.badapples", indexReader11, termsEnum12, termsEnum13, false); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00174() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00174"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoShapeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geoShape-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00175() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00175"); java.lang.String[] strArray2 = new java.lang.String[] { "" }; java.lang.String[][] strArray3 = new java.lang.String[][] { strArray2 }; java.lang.String[] strArray5 = new java.lang.String[] { "" }; java.lang.String[][] strArray6 = new java.lang.String[][] { strArray5 }; java.lang.String[] strArray8 = new java.lang.String[] { "" }; java.lang.String[][] strArray9 = new java.lang.String[][] { strArray8 }; java.lang.String[] strArray11 = new java.lang.String[] { "" }; java.lang.String[][] strArray12 = new java.lang.String[][] { strArray11 }; java.lang.String[] strArray14 = new java.lang.String[] { "" }; java.lang.String[][] strArray15 = new java.lang.String[][] { strArray14 }; java.lang.String[][][] strArray16 = new java.lang.String[][][] { strArray3, strArray6, strArray9, strArray12, strArray15 }; // The following exception was thrown during execution in test generation try { java.util.List<java.lang.String[][]> strArrayList17 = org.elasticsearch.test.ElasticsearchTestCase.randomSubsetOf((int) (short) 100, strArray16); org.junit.Assert.fail("Expected exception of type java.lang.IllegalArgumentException; message: Can't pick 100 random objects from a list of 5 objects"); } catch (java.lang.IllegalArgumentException e) { // Expected exception. } org.junit.Assert.assertNotNull(strArray2); org.junit.Assert.assertNotNull(strArray3); org.junit.Assert.assertNotNull(strArray5); org.junit.Assert.assertNotNull(strArray6); org.junit.Assert.assertNotNull(strArray8); org.junit.Assert.assertNotNull(strArray9); org.junit.Assert.assertNotNull(strArray11); org.junit.Assert.assertNotNull(strArray12); org.junit.Assert.assertNotNull(strArray14); org.junit.Assert.assertNotNull(strArray15); org.junit.Assert.assertNotNull(strArray16); } @Test public void test00176() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00176"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.elasticsearch.common.unit.TimeValue timeValue8 = null; java.lang.String[] strArray11 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet12 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray11); // The following exception was thrown during execution in test generation try { org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus clusterHealthStatus13 = simpleIndexQueryParserTests0.ensureGreen(timeValue8, strArray11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(strArray11); org.junit.Assert.assertNotNull(strComparableSet12); } @Test public void test00177() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00177"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testWildcardBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/wildcard-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00178() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00178"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.IndexReader indexReader4 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertReaderStatisticsEquals("tests.nightly", indexReader3, indexReader4); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00179() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00179"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00180() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00180"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMatchAll(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/matchAll.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00181() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00181"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00182() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00182"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path0 = org.apache.lucene.util.LuceneTestCase.createTempFile(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00183() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00183"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.SYSPROP_MONSTER; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "tests.monster" + "'", str0, "tests.monster"); } @Test public void test00184() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00184"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testDefaultBooleanQueryMinShouldMatch(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00185() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00185"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMoreLikeThis(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/mlt.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00186() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00186"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCustomBoostFactorQueryBuilder_withFunctionScore(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00187() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00187"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); org.apache.lucene.index.TermsEnum termsEnum4 = null; org.apache.lucene.index.TermsEnum termsEnum5 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermStatsEquals("europarl.lines.txt.gz", termsEnum4, termsEnum5); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00188() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00188"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBadTypeMatchQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/match-query-bad-type.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00189() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00189"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00190() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00190"); java.util.Random random0 = null; org.apache.lucene.util.BytesRef bytesRef2 = null; org.apache.lucene.document.Field.Store store3 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field4 = org.apache.lucene.util.LuceneTestCase.newStringField(random0, "tests.awaitsfix", bytesRef2, store3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00191() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00191"); // The following exception was thrown during execution in test generation try { double double0 = org.elasticsearch.test.ElasticsearchTestCase.randomDouble(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00192() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00192"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMatchAll(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/matchAll.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00193() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00193"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testWildcardBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/wildcard-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00194() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00194"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQueryBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix-with-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00195() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00195"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanWithinQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00196() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00196"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter11(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance11.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00197() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00197"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00198() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00198"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilterParsingExceptions(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon_exception_1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00199() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00199"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCustomBoostFactorQueryBuilder_withFunctionScore(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00200() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00200"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonNamedFilter(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00201() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00201"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomRealisticUnicodeOfLength((int) (short) -1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00202() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00202"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.assertsAreEnabled; // flaky: org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00203() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00203"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilterNamed(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00204() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00204"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.apache.lucene.index.IndexReader indexReader10 = null; org.apache.lucene.index.IndexReader indexReader11 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertReaderStatisticsEquals("tests.nightly", indexReader10, indexReader11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00205() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00205"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00206() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00206"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { // flaky: simpleIndexQueryParserTests0.testWeight1fStillProducesWeighFunction(); // flaky: org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00207() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00207"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexableField indexableField11 = null; org.apache.lucene.index.IndexableField indexableField12 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldEquals("node_s_0", indexableField11, indexableField12); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00208() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00208"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermsFilterQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00209() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00209"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanMultiTermPrefixQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/span-multi-term-prefix.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00210() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00210"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilter1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00211() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00211"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00212() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00212"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests1 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests1.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.Fields fields5 = null; org.apache.lucene.index.Fields fields6 = null; simpleIndexQueryParserTests1.assertFieldsEquals("tests.failfast", indexReader4, fields5, fields6, false); org.junit.rules.RuleChain ruleChain9 = simpleIndexQueryParserTests1.failureAndSuccessEvents; org.junit.rules.RuleChain[] ruleChainArray10 = new org.junit.rules.RuleChain[] { ruleChain9 }; // The following exception was thrown during execution in test generation try { java.util.List<org.junit.rules.RuleChain> ruleChainList11 = org.elasticsearch.test.ElasticsearchTestCase.randomSubsetOf(100, ruleChainArray10); org.junit.Assert.fail("Expected exception of type java.lang.IllegalArgumentException; message: Can't pick 100 random objects from a list of 1 objects"); } catch (java.lang.IllegalArgumentException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain9); org.junit.Assert.assertNotNull(ruleChainArray10); } @Test public void test00213() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00213"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter5(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox5.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00214() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00214"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00215() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00215"); // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.setupSpins(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00216() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00216"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00217() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00217"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNotQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00218() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00218"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.randomIntBetween((int) (byte) 1, (int) (short) -1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00219() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00219"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanContainingQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00220() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00220"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.TermsEnum termsEnum11 = null; org.apache.lucene.index.TermsEnum termsEnum12 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermStatsEquals("tests.nightly", termsEnum11, termsEnum12); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00221() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00221"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.IndexReader indexReader4 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldsEquals("random", indexReader3, indexReader4); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00222() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00222"); int int0 = org.apache.lucene.util.LuceneTestCase.RANDOM_MULTIPLIER; org.junit.Assert.assertTrue("'" + int0 + "' != '" + 1 + "'", int0 == 1); } @Test public void test00223() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00223"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanMultiTermTermRangeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/span-multi-term-range-term.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00224() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00224"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBadTypeMatchQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/match-query-bad-type.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00225() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00225"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilterNamed(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00226() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00226"); java.util.Locale locale1 = org.apache.lucene.util.LuceneTestCase.localeForName("node_s_0"); java.lang.Class<?> wildcardClass2 = locale1.getClass(); org.junit.Assert.assertNotNull(locale1); org.junit.Assert.assertEquals(locale1.toString(), "node_S_0"); org.junit.Assert.assertNotNull(wildcardClass2); } @Test public void test00227() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00227"); boolean boolean0 = org.apache.lucene.util.LuceneTestCase.TEST_SLOW; org.junit.Assert.assertTrue("'" + boolean0 + "' != '" + false + "'", boolean0 == false); } @Test public void test00228() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00228"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermWithBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/term-with-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00229() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00229"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy1 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(false); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00230() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00230"); java.util.concurrent.ExecutorService[] executorServiceArray0 = null; // The following exception was thrown during execution in test generation try { boolean boolean1 = org.elasticsearch.test.ElasticsearchTestCase.terminate(executorServiceArray0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00231() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00231"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00232() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00232"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter9(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance9.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00233() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00233"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter10(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance10.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00234() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00234"); java.lang.String[] strArray3 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet4 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray3); java.io.PrintStream printStream5 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.dumpArray("europarl.lines.txt.gz", (java.lang.Object[]) strArray3, printStream5); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(strArray3); org.junit.Assert.assertNotNull(strComparableSet4); } @Test public void test00235() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00235"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { java.lang.String[] strArray3 = simpleIndexQueryParserTests0.tmpPaths(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00236() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00236"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields1Builder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00237() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00237"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00238() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00238"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.elasticsearch.common.unit.TimeValue timeValue10 = null; java.lang.String[] strArray11 = new java.lang.String[] {}; // The following exception was thrown during execution in test generation try { org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus clusterHealthStatus12 = simpleIndexQueryParserTests0.ensureGreen(timeValue10, strArray11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(strArray11); } @Test public void test00239() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00239"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoostingQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00240() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00240"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanFirstQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanFirst.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00241() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00241"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanOrQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanOr.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00242() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00242"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomAsciiOfLengthBetween((int) (short) 1, (int) (short) 10); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00243() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00243"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.LogMergePolicy logMergePolicy1 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00244() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00244"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testOrFilteredQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/or-filter2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00245() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00245"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.SYSPROP_SLOW; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "tests.slow" + "'", str0, "tests.slow"); } @Test public void test00246() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00246"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00247() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00247"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.IndexReader indexReader12 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermVectorsEquals("tests.monster", indexReader11, indexReader12); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00248() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00248"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.IndexReader indexReader4 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertDeletedDocsEquals("tests.failfast", indexReader3, indexReader4); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00249() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00249"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00250() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00250"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMatchWithoutFuzzyTranspositions(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/match-without-fuzzy-transpositions.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00251() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00251"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00252() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00252"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNotQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00253() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00253"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00254() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00254"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { // flaky: simpleIndexQueryParserTests0.testWeight1fStillProducesWeighFunction(); // flaky: org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00255() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00255"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00256() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00256"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00257() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00257"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.TermsEnum termsEnum4 = null; org.apache.lucene.index.TermsEnum termsEnum5 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermsEnumEquals("enwiki.random.lines.txt", indexReader3, termsEnum4, termsEnum5, true); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00258() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00258"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFieldsMatch(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-fields-match.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00259() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00259"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00260() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00260"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.apache.lucene.index.TermsEnum termsEnum10 = null; org.apache.lucene.index.TermsEnum termsEnum11 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermStatsEquals("europarl.lines.txt.gz", termsEnum10, termsEnum11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00261() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00261"); java.lang.String[] strArray5 = new java.lang.String[] { "hi!", "tests.nightly", "tests.failfast", "hi!", "" }; java.lang.String[] strArray11 = new java.lang.String[] { "hi!", "tests.nightly", "tests.failfast", "hi!", "" }; java.lang.String[][] strArray12 = new java.lang.String[][] { strArray5, strArray11 }; java.util.Set<java.lang.String[]> strArraySet13 = org.apache.lucene.util.LuceneTestCase.asSet(strArray12); // The following exception was thrown during execution in test generation try { java.lang.Cloneable cloneable14 = org.elasticsearch.test.ElasticsearchTestCase.randomFrom((java.lang.Cloneable[]) strArray12); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } org.junit.Assert.assertNotNull(strArray5); org.junit.Assert.assertNotNull(strArray11); org.junit.Assert.assertNotNull(strArray12); org.junit.Assert.assertNotNull(strArraySet13); } @Test public void test00262() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00262"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanWithinQueryParser(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanWithin.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00263() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00263"); // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.assumeFalse("enwiki.random.lines.txt", true); org.junit.Assert.fail("Expected exception of type com.carrotsearch.randomizedtesting.InternalAssumptionViolatedException; message: enwiki.random.lines.txt"); } catch (org.junit.internal.AssumptionViolatedException e) { // Expected exception. } } @Test public void test00264() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00264"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields1Builder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00265() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00265"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeNamedFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00266() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00266"); java.util.Random random0 = null; org.apache.lucene.util.BytesRef bytesRef2 = null; org.apache.lucene.document.Field.Store store3 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field4 = org.apache.lucene.util.LuceneTestCase.newStringField(random0, "node_s_0", bytesRef2, store3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00267() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00267"); java.util.Random random0 = null; org.apache.lucene.util.BytesRef bytesRef2 = null; org.apache.lucene.document.Field.Store store3 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field4 = org.apache.lucene.util.LuceneTestCase.newStringField(random0, "tests.monster", bytesRef2, store3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00268() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00268"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoShapeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geoShape-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00269() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00269"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testProperErrorMessageWhenTwoFunctionsDefinedInQueryBody(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/function-score-query-causing-NPE.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00270() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00270"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testWildcardBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/wildcard-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00271() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00271"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMatchAllEmpty2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/match_all_empty2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00272() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00272"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assureMalformedThrowsException(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/faulty-function-score-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00273() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00273"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoostingQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00274() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00274"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testConstantScoreQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00275() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00275"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFQueryFilter(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/fquery-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00276() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00276"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00277() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00277"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter6(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance6.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00278() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00278"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.scaledRandomIntBetween((int) '#', (int) '4'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00279() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00279"); java.util.Locale locale1 = org.apache.lucene.util.LuceneTestCase.localeForName("tests.badapples"); org.junit.Assert.assertNotNull(locale1); org.junit.Assert.assertEquals(locale1.toString(), "tests.badapples"); } @Test public void test00280() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00280"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/not-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00281() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00281"); java.lang.String[] strArray3 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet4 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray3); java.io.PrintStream printStream5 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.dumpArray("tests.nightly", (java.lang.Object[]) strArray3, printStream5); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(strArray3); org.junit.Assert.assertNotNull(strComparableSet4); } @Test public void test00282() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00282"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomRealisticUnicodeOfCodepointLengthBetween((int) '4', (int) 'a'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00283() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00283"); org.apache.lucene.util.LuceneTestCase.resetDefaultQueryCache(); } @Test public void test00284() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00284"); // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.assumeTrue("tests.nightly", false); org.junit.Assert.fail("Expected exception of type com.carrotsearch.randomizedtesting.InternalAssumptionViolatedException; message: tests.nightly"); } catch (org.junit.internal.AssumptionViolatedException e) { // Expected exception. } } @Test public void test00285() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00285"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFilteredQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/filtered-query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00286() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00286"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefiFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00287() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00287"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testEmptyBoolSubClausesIsMatchAll(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool-query-with-empty-clauses-for-parsing.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00288() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00288"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00289() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00289"); java.util.Random random0 = null; org.apache.lucene.store.Directory directory1 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.BaseDirectoryWrapper baseDirectoryWrapper2 = org.apache.lucene.util.LuceneTestCase.newDirectory(random0, directory1); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00290() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00290"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomAsciiOfLengthBetween((int) (short) 100, (int) (byte) 0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00291() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00291"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.tearDown(); org.junit.Assert.fail("Expected exception of type java.lang.RuntimeException; message: The rule is not currently executing."); } catch (java.lang.RuntimeException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00292() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00292"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); org.apache.lucene.index.TermsEnum termsEnum10 = null; org.apache.lucene.index.TermsEnum termsEnum11 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermStatsEquals("tests.nightly", termsEnum10, termsEnum11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00293() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00293"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermWithBoostQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00294() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00294"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.tearDown(); org.junit.Assert.fail("Expected exception of type java.lang.RuntimeException; message: The rule is not currently executing."); } catch (java.lang.RuntimeException e) { // Expected exception. } } @Test public void test00295() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00295"); java.lang.Runnable runnable0 = null; java.util.concurrent.TimeUnit timeUnit2 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.test.ElasticsearchTestCase.assertBusy(runnable0, (long) (byte) 0, timeUnit2); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00296() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00296"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter5(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance5.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00297() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00297"); org.apache.lucene.index.IndexReader indexReader0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.search.IndexSearcher indexSearcher1 = org.apache.lucene.util.LuceneTestCase.newSearcher(indexReader0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00298() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00298"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.apache.lucene.index.IndexReader indexReader10 = null; org.apache.lucene.index.IndexReader indexReader11 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertDeletedDocsEquals("tests.slow", indexReader10, indexReader11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00299() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00299"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00300() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00300"); java.nio.file.Path path0 = null; org.apache.lucene.store.LockFactory lockFactory1 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.store.MockDirectoryWrapper mockDirectoryWrapper2 = org.apache.lucene.util.LuceneTestCase.newMockFSDirectory(path0, lockFactory1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00301() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00301"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00302() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00302"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testOrFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/or-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00303() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00303"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); org.apache.lucene.index.PostingsEnum postingsEnum11 = null; org.apache.lucene.index.PostingsEnum postingsEnum12 = null; simpleIndexQueryParserTests0.assertDocsEnumEquals("europarl.lines.txt.gz", postingsEnum11, postingsEnum12, true); org.elasticsearch.common.unit.TimeValue timeValue15 = null; java.lang.String[] strArray18 = new java.lang.String[] { "tests.badapples", "tests.awaitsfix" }; java.util.Set<java.lang.Comparable<java.lang.String>> strComparableSet19 = org.apache.lucene.util.LuceneTestCase.asSet((java.lang.Comparable<java.lang.String>[]) strArray18); // The following exception was thrown during execution in test generation try { org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus clusterHealthStatus20 = simpleIndexQueryParserTests0.ensureGreen(timeValue15, strArray18); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); org.junit.Assert.assertNotNull(strArray18); org.junit.Assert.assertNotNull(strComparableSet19); } @Test public void test00304() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00304"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpFilteredQueryWithMaxDeterminizedStates(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter-max-determinized-states.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00305() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00305"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.tearDown(); org.junit.Assert.fail("Expected exception of type java.lang.RuntimeException; message: The rule is not currently executing."); } catch (java.lang.RuntimeException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00306() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00306"); org.junit.Assert.assertEquals("tests.slow", (double) 0, (double) (byte) 10, (double) (byte) 10); } @Test public void test00307() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00307"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMoreLikeThis(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/mlt.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00308() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00308"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testAndFilteredQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00309() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00309"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testInQuery(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00310() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00310"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNamedAndCachedRegexpWithFlagsFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter-flags-named-cached.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00311() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00311"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfCodepointLengthBetween((int) (byte) 100, (int) 'a'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00312() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00312"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (short) 1); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoShapeFilter(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geoShape-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00313() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00313"); // The following exception was thrown during execution in test generation try { int int1 = org.elasticsearch.test.ElasticsearchTestCase.randomInt((int) (byte) 100); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00314() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00314"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpQueryWithMaxDeterminizedStates(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-max-determinized-states.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00315() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00315"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMatchWithFuzzyTranspositions(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/match-with-fuzzy-transpositions.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00316() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00316"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00317() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00317"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader18 = null; org.apache.lucene.index.IndexReader indexReader19 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertNormsEquals("tests.badapples", indexReader18, indexReader19); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00318() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00318"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFieldsMatch(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-fields-match.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00319() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00319"); // The following exception was thrown during execution in test generation try { java.lang.String str1 = org.elasticsearch.test.ElasticsearchTestCase.randomRealisticUnicodeOfCodepointLength(0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00320() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00320"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/filtered-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00321() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00321"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMoreLikeThisIds(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00322() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00322"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpQueryWithMaxDeterminizedStates(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-max-determinized-states.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00323() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00323"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFieldsMatch(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-fields-match.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00324() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00324"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoShapeFilter(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geoShape-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00325() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00325"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00326() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00326"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQueryWithUnknownField(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00327() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00327"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermsQueryFilter(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00328() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00328"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFieldMaskingSpanQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanFieldMaskingTerm.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00329() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00329"); org.elasticsearch.test.ElasticsearchTestCase.setDefaultExceptionHandler(); } @Test public void test00330() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00330"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00331() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00331"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); org.apache.lucene.index.PostingsEnum postingsEnum11 = null; org.apache.lucene.index.PostingsEnum postingsEnum12 = null; simpleIndexQueryParserTests0.assertDocsEnumEquals("europarl.lines.txt.gz", postingsEnum11, postingsEnum12, true); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermWithBoostQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00332() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00332"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy2 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(true, (-1)); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00333() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00333"); java.lang.Runnable runnable0 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.test.ElasticsearchTestCase.assertBusy(runnable0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00334() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00334"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.setup(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00335() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00335"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00336() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00336"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMatchAllBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00337() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00337"); org.apache.lucene.document.Field.Store store2 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field3 = org.apache.lucene.util.LuceneTestCase.newTextField("random", "tests.awaitsfix", store2); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00338() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00338"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter5(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox5.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00339() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00339"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testWildcardQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00340() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00340"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (short) 1); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00341() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00341"); org.elasticsearch.test.ElasticsearchTestCase.restoreContentType(); } @Test public void test00342() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00342"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testEmptyBoolSubClausesIsMatchAll(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool-query-with-empty-clauses-for-parsing.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00343() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00343"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFilterParsing(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/function-filter-score-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00344() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00344"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/not-filter2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00345() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00345"); org.junit.Assert.assertEquals("hi!", (double) 1L, (double) 1, (double) '4'); } @Test public void test00346() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00346"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeNamedFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00347() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00347"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.apache.lucene.index.IndexReader indexReader10 = null; org.apache.lucene.index.IndexReader indexReader11 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertReaderStatisticsEquals("random", indexReader10, indexReader11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00348() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00348"); org.apache.lucene.store.Directory directory0 = null; // The following exception was thrown during execution in test generation try { boolean boolean2 = org.apache.lucene.util.LuceneTestCase.slowFileExists(directory0, "europarl.lines.txt.gz"); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00349() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00349"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); org.apache.lucene.index.IndexableField indexableField2 = null; org.apache.lucene.index.IndexableField indexableField3 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldEquals("enwiki.random.lines.txt", indexableField2, indexableField3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00350() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00350"); // The following exception was thrown during execution in test generation try { org.apache.lucene.util.LuceneTestCase.assumeTrue("node_s_0", false); org.junit.Assert.fail("Expected exception of type com.carrotsearch.randomizedtesting.InternalAssumptionViolatedException; message: node_s_0"); } catch (org.junit.internal.AssumptionViolatedException e) { // Expected exception. } } @Test public void test00351() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00351"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQueryBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix-with-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00352() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00352"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00353() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00353"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpFilteredQueryWithMaxDeterminizedStates(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter-max-determinized-states.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00354() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00354"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfLengthBetween((int) '4', (int) ' '); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00355() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00355"); java.util.Random random0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.TieredMergePolicy tieredMergePolicy1 = org.apache.lucene.util.LuceneTestCase.newTieredMergePolicy(random0); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00356() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00356"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testDisMaxBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00357() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00357"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanContainingQueryParser(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanContaining.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00358() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00358"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefiFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00359() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00359"); org.apache.lucene.index.IndexReader indexReader0 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.search.IndexSearcher indexSearcher2 = org.apache.lucene.util.LuceneTestCase.newSearcher(indexReader0, true); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00360() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00360"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermsFilterQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/terms-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00361() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00361"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); org.elasticsearch.common.settings.Settings settings9 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.env.NodeEnvironment nodeEnvironment10 = simpleIndexQueryParserTests0.newNodeEnvironment(settings9); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00362() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00362"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermsQueryFilter(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00363() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00363"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilterNamed(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00364() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00364"); java.util.Random random0 = null; org.apache.lucene.document.FieldType fieldType3 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field4 = org.apache.lucene.util.LuceneTestCase.newField(random0, "tests.monster", (java.lang.Object) "europarl.lines.txt.gz", fieldType3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00365() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00365"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { org.elasticsearch.env.NodeEnvironment nodeEnvironment2 = simpleIndexQueryParserTests0.newNodeEnvironment(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00366() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00366"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoShapeFilter(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geoShape-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00367() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00367"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanContainingQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00368() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00368"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testStarColonStar(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/starColonStar.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00369() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00369"); org.apache.lucene.util.BytesRef bytesRef1 = null; org.apache.lucene.document.Field.Store store2 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field3 = org.apache.lucene.util.LuceneTestCase.newStringField("", bytesRef1, store2); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00370() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00370"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/filtered-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00371() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00371"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (short) 1); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFuzzyQueryWithFields2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/fuzzy-with-fields2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00372() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00372"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00373() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00373"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00374() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00374"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRange2Query(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00375() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00375"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); org.elasticsearch.common.settings.Settings settings18 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.env.NodeEnvironment nodeEnvironment19 = simpleIndexQueryParserTests0.newNodeEnvironment(settings18); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00376() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00376"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermsQueryFilter(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00377() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00377"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter9(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance9.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00378() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00378"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (short) 1); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermNamedFilterQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/term-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00379() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00379"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00380() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00380"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter6(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance6.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00381() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00381"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (short) 1); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanMultiTermNumericRangeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/span-multi-term-range-numeric.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00382() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00382"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (short) 1); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00383() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00383"); // The following exception was thrown during execution in test generation try { int int1 = org.elasticsearch.test.ElasticsearchTestCase.randomInt(0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00384() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00384"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.IndexReader indexReader12 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldsEquals("europarl.lines.txt.gz", indexReader11, indexReader12); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00385() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00385"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoShapeQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geoShape-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00386() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00386"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMultiMatchQueryWithFieldsAsString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/multiMatch-query-fields-as-string.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00387() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00387"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00388() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00388"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); org.apache.lucene.index.PostingsEnum postingsEnum11 = null; org.apache.lucene.index.PostingsEnum postingsEnum12 = null; simpleIndexQueryParserTests0.assertDocsEnumEquals("europarl.lines.txt.gz", postingsEnum11, postingsEnum12, true); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanTermQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00389() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00389"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00390() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00390"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanWithinQueryParser(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanWithin.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00391() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00391"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringRegexp(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-regexp-max-determinized-states.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00392() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00392"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFuzzyNumeric(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00393() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00393"); // The following exception was thrown during execution in test generation try { int int2 = org.elasticsearch.test.ElasticsearchTestCase.randomIntBetween((int) (byte) 100, (int) (byte) -1); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00394() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00394"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanTermQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanTerm.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00395() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00395"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFuzzyQueryWithFields(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/fuzzy-with-fields.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00396() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00396"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { // flaky: simpleIndexQueryParserTests0.testEmptyBooleanQuery(); // flaky: org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00397() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00397"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolFilteredQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00398() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00398"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanContainingQueryParser(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanContaining.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00399() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00399"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/not-filter2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00400() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00400"); org.apache.lucene.document.FieldType fieldType2 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field3 = org.apache.lucene.util.LuceneTestCase.newField("node_s_0", "europarl.lines.txt.gz", fieldType2); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00401() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00401"); java.util.Random random0 = null; org.apache.lucene.analysis.Analyzer analyzer1 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.index.IndexWriterConfig indexWriterConfig2 = org.apache.lucene.util.LuceneTestCase.newIndexWriterConfig(random0, analyzer1); org.junit.Assert.fail("Expected exception of type java.util.ServiceConfigurationError; message: Cannot instantiate SPI class: org.apache.lucene.codecs.asserting.AssertingCodec"); } catch (java.util.ServiceConfigurationError e) { // Expected exception. } } @Test public void test00402() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00402"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testEmptyBoolSubClausesIsMatchAll(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool-query-with-empty-clauses-for-parsing.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00403() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00403"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00404() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00404"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testAndFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/and-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00405() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00405"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields2Builder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00406() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00406"); org.junit.Assert.assertEquals("node_s_0", (double) (byte) 10, 10.0d, (double) (short) 0); } @Test public void test00407() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00407"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testOrFilteredQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00408() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00408"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testStarColonStar(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/starColonStar.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00409() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00409"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testWildcardQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/wildcard.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00410() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00410"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.PostingsEnum postingsEnum5 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("", indexReader3, (int) (byte) 100, postingsEnum5, postingsEnum6); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNotQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanNot.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00411() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00411"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCustomBoostFactorQueryBuilder_withFunctionScore(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00412() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00412"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testOrFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/or-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00413() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00413"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testEmptyBooleanQueryInsideFQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/fquery-with-empty-bool-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00414() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00414"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.ensureCleanedUp(); org.elasticsearch.common.settings.Settings settings3 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.env.NodeEnvironment nodeEnvironment4 = simpleIndexQueryParserTests0.newNodeEnvironment(settings3); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00415() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00415"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanMultiTermWildcardQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/span-multi-term-wildcard.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00416() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00416"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00417() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00417"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQuery3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/not-filter3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00418() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00418"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQueryBoostQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00419() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00419"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMultiMatchQueryWithFieldsAsString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/multiMatch-query-fields-as-string.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00420() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00420"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.restoreIndexWriterMaxDocs(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter4(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox4.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00421() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00421"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRangeFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/range-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00422() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00422"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testEmptyBoolSubClausesIsMatchAll(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/bool-query-with-empty-clauses-for-parsing.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00423() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00423"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); org.apache.lucene.index.PostingsEnum postingsEnum11 = null; org.apache.lucene.index.PostingsEnum postingsEnum12 = null; simpleIndexQueryParserTests0.assertDocsEnumEquals("europarl.lines.txt.gz", postingsEnum11, postingsEnum12, true); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFQueryFilter(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/fquery-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00424() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00424"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSimpleQueryString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/simple-query-string.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00425() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00425"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpQueryWithMaxDeterminizedStates(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-max-determinized-states.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00426() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00426"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMultiMatchQueryWithFieldsAsString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/multiMatch-query-fields-as-string.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00427() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00427"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.restoreIndexWriterMaxDocs(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanOrQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanOr.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00428() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00428"); java.util.Random random0 = null; java.util.Locale locale3 = org.apache.lucene.util.LuceneTestCase.localeForName("node_s_0"); org.apache.lucene.document.FieldType fieldType4 = null; // The following exception was thrown during execution in test generation try { org.apache.lucene.document.Field field5 = org.apache.lucene.util.LuceneTestCase.newField(random0, "tests.nightly", (java.lang.Object) "node_s_0", fieldType4); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(locale3); org.junit.Assert.assertEquals(locale3.toString(), "node_S_0"); } @Test public void test00429() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00429"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.IndexReader indexReader5 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertReaderEquals("europarl.lines.txt.gz", indexReader4, indexReader5); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00430() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00430"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolFilteredQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00431() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00431"); java.lang.Runnable runnable0 = null; java.util.concurrent.TimeUnit timeUnit2 = null; // The following exception was thrown during execution in test generation try { org.elasticsearch.test.ElasticsearchTestCase.assertBusy(runnable0, (long) 0, timeUnit2); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00432() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00432"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00433() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00433"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { // flaky: simpleIndexQueryParserTests0.testTermsFilterWithMultipleFields(); // flaky: org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00434() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00434"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00435() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00435"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests10 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests10.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader13 = null; org.apache.lucene.index.Fields fields14 = null; org.apache.lucene.index.Fields fields15 = null; simpleIndexQueryParserTests10.assertFieldsEquals("tests.failfast", indexReader13, fields14, fields15, false); simpleIndexQueryParserTests10.ensureAllSearchContextsReleased(); org.junit.Assert.assertNotSame((java.lang.Object) false, (java.lang.Object) simpleIndexQueryParserTests10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests10.testQueryStringBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00436() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00436"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-fields3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00437() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00437"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoolFilteredQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00438() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00438"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path2 = org.apache.lucene.util.LuceneTestCase.createTempFile("tests.awaitsfix", "europarl.lines.txt.gz"); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00439() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00439"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.setup(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00440() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00440"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); org.apache.lucene.index.PostingsEnum postingsEnum11 = null; org.apache.lucene.index.PostingsEnum postingsEnum12 = null; simpleIndexQueryParserTests0.assertDocsEnumEquals("europarl.lines.txt.gz", postingsEnum11, postingsEnum12, true); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/not-filter2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00441() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00441"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermWithBoostQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/term-with-boost.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00442() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00442"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy2 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(false, (-1)); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00443() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00443"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00444() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00444"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfCodepointLengthBetween((int) (byte) 0, (int) 'a'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00445() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00445"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.restoreIndexWriterMaxDocs(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testNotFilteredQuery2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/not-filter2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00446() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00446"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSimpleQueryString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/simple-query-string.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00447() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00447"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomAsciiOfLengthBetween((int) (byte) 100, (int) 'a'); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00448() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00448"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFuzzyNumeric(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00449() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00449"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanContainingQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00450() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00450"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.apache.lucene.index.IndexReader indexReader10 = null; org.apache.lucene.index.IndexReader indexReader11 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertDocValuesEquals("", indexReader10, indexReader11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00451() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00451"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNotQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanNot.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00452() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00452"); java.lang.String str0 = org.apache.lucene.util.LuceneTestCase.SYSPROP_MAXFAILURES; org.junit.Assert.assertEquals("'" + str0 + "' != '" + "tests.maxfailures" + "'", str0, "tests.maxfailures"); } @Test public void test00453() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00453"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (byte) 0); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMultiMatchQueryWithFieldsAsString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/multiMatch-query-fields-as-string.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00454() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00454"); // The following exception was thrown during execution in test generation try { java.nio.file.Path path1 = org.apache.lucene.util.LuceneTestCase.createTempDir("europarl.lines.txt.gz"); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00455() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00455"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.IndexReader indexReader12 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldsEquals("tests.awaitsfix", indexReader11, indexReader12); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00456() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00456"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-fields3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00457() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00457"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (byte) 0); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpQueryWithMaxDeterminizedStates(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-max-determinized-states.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00458() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00458"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpWithFlagsFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter-flags.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00459() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00459"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixNamedFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix-filter-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00460() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00460"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testCommonTermsQuery3(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/commonTerms-query3.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00461() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00461"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.PostingsEnum postingsEnum5 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("", indexReader3, (int) (byte) 100, postingsEnum5, postingsEnum6); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMoreLikeThisIds(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00462() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00462"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); org.apache.lucene.index.IndexReader indexReader5 = null; org.apache.lucene.index.Terms terms6 = null; org.apache.lucene.index.Terms terms7 = null; simpleIndexQueryParserTests0.assertTermsEquals("tests.nightly", indexReader5, terms6, terms7, false); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests10 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests10.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader13 = null; org.apache.lucene.index.Fields fields14 = null; org.apache.lucene.index.Fields fields15 = null; simpleIndexQueryParserTests10.assertFieldsEquals("tests.failfast", indexReader13, fields14, fields15, false); simpleIndexQueryParserTests10.ensureAllSearchContextsReleased(); org.junit.Assert.assertNotSame((java.lang.Object) false, (java.lang.Object) simpleIndexQueryParserTests10); org.apache.lucene.index.IndexReader indexReader21 = null; org.apache.lucene.index.IndexReader indexReader22 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests10.assertStoredFieldsEquals("tests.slow", indexReader21, indexReader22); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00463() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00463"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter8(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance8.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00464() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00464"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.resetCheckIndexStatus(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilterParsingExceptions(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon_exception_1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00465() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00465"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/term.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00466() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00466"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNearQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanNear.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00467() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00467"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoostingQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00468() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00468"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSimpleQueryString(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/simple-query-string.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00469() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00469"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); org.apache.lucene.index.Terms terms10 = null; org.apache.lucene.index.Terms terms11 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertTermsStatisticsEquals("tests.awaitsfix", terms10, terms11); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00470() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00470"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00471() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00471"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testPrefixQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/prefix.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00472() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00472"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanWithinQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00473() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00473"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { // flaky: simpleIndexQueryParserTests0.testFuzzyQueryWithFieldsBuilder(); // flaky: org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00474() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00474"); org.elasticsearch.test.ElasticsearchTestCase.checkIndexFailed = true; } @Test public void test00475() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00475"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testFieldMaskingSpanQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanFieldMaskingTerm.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00476() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00476"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { java.nio.file.Path path18 = simpleIndexQueryParserTests0.getDataPath("tests.maxfailures"); org.junit.Assert.fail("Expected exception of type java.lang.RuntimeException; message: resource not found: tests.maxfailures"); } catch (java.lang.RuntimeException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00477() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00477"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy2 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(true, (int) (short) 10); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00478() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00478"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00479() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00479"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.PostingsEnum postingsEnum5 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("", indexReader3, (int) (byte) 100, postingsEnum5, postingsEnum6); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermsQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/terms-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00480() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00480"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (byte) 0); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilter1(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00481() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00481"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoBoundingBoxFilterNamed(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_boundingbox-named.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00482() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00482"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (byte) 0); org.apache.lucene.index.IndexReader indexReader21 = null; org.apache.lucene.index.PostingsEnum postingsEnum23 = null; org.apache.lucene.index.PostingsEnum postingsEnum24 = null; simpleIndexQueryParserTests0.assertDocsSkippingEquals("tests.failfast", indexReader21, (int) ' ', postingsEnum23, postingsEnum24, true); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testRegexpFilteredQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/regexp-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00483() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00483"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilter2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00484() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00484"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; java.lang.String str9 = simpleIndexQueryParserTests0.getTestName(); org.apache.lucene.index.PostingsEnum postingsEnum11 = null; org.apache.lucene.index.PostingsEnum postingsEnum12 = null; simpleIndexQueryParserTests0.assertDocsEnumEquals("europarl.lines.txt.gz", postingsEnum11, postingsEnum12, true); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNearQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/spanNear.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertEquals("'" + str9 + "' != '" + "<unknown>" + "'", str9, "<unknown>"); } @Test public void test00485() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00485"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testSpanNotQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00486() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00486"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) (byte) 0); org.apache.lucene.index.IndexReader indexReader21 = null; org.apache.lucene.index.PostingsEnum postingsEnum23 = null; org.apache.lucene.index.PostingsEnum postingsEnum24 = null; simpleIndexQueryParserTests0.assertDocsSkippingEquals("tests.failfast", indexReader21, (int) ' ', postingsEnum23, postingsEnum24, true); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testBoostingQueryBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00487() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00487"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("tests.awaitsfix", indexReader11, (int) 'a', postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.setIndexWriterMaxDocs(10); // The following exception was thrown during execution in test generation try { java.lang.String[] strArray18 = simpleIndexQueryParserTests0.tmpPaths(); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00488() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00488"); // The following exception was thrown during execution in test generation try { java.lang.String str2 = org.elasticsearch.test.ElasticsearchTestCase.randomUnicodeOfCodepointLengthBetween((int) ' ', (int) (short) 10); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } @Test public void test00489() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00489"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.junit.rules.RuleChain ruleChain9 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermFilterQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/term-filter.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain9); } @Test public void test00490() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00490"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testTermsQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/terms-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00491() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00491"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.junit.rules.RuleChain ruleChain9 = simpleIndexQueryParserTests0.failureAndSuccessEvents; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoPolygonFilterParsingExceptions(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_polygon_exception_1.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain9); } @Test public void test00492() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00492"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); simpleIndexQueryParserTests0.setIndexWriterMaxDocs((int) '4'); org.apache.lucene.index.IndexReader indexReader6 = null; org.apache.lucene.index.PostingsEnum postingsEnum8 = null; org.apache.lucene.index.PostingsEnum postingsEnum9 = null; simpleIndexQueryParserTests0.assertDocsSkippingEquals("node_s_0", indexReader6, (int) (short) -1, postingsEnum8, postingsEnum9, true); // The following exception was thrown during execution in test generation try { // flaky: simpleIndexQueryParserTests0.testTermsQueryWithMultipleFields(); // flaky: org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00493() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00493"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); org.junit.rules.RuleChain ruleChain16 = simpleIndexQueryParserTests0.failureAndSuccessEvents; org.apache.lucene.index.IndexReader indexReader18 = null; org.apache.lucene.index.IndexReader indexReader19 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertDeletedDocsEquals("tests.maxfailures", indexReader18, indexReader19); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); org.junit.Assert.assertNotNull(ruleChain16); } @Test public void test00494() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00494"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); simpleIndexQueryParserTests0.ensureAllSearchContextsReleased(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields2Builder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00495() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00495"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.restoreIndexWriterMaxDocs(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testConstantScoreQuery(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/constantScore-query.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } } @Test public void test00496() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00496"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexReader indexReader11 = null; org.apache.lucene.index.PostingsEnum postingsEnum13 = null; org.apache.lucene.index.PostingsEnum postingsEnum14 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("enwiki.random.lines.txt", indexReader11, (int) (byte) 1, postingsEnum13, postingsEnum14); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testGeoDistanceFilter9(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/geo_distance9.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00497() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00497"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader4 = null; org.apache.lucene.index.PostingsEnum postingsEnum6 = null; org.apache.lucene.index.PostingsEnum postingsEnum7 = null; simpleIndexQueryParserTests0.assertPositionsSkippingEquals("node_s_0", indexReader4, 1, postingsEnum6, postingsEnum7); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testMoreLikeThisBuilder(); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00498() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00498"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.ensureCleanedUp(); org.apache.lucene.index.IndexableField indexableField3 = null; org.apache.lucene.index.IndexableField indexableField4 = null; // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.assertStoredFieldEquals("enwiki.random.lines.txt", indexableField3, indexableField4); org.junit.Assert.fail("Expected exception of type java.lang.NullPointerException; message: null"); } catch (java.lang.NullPointerException e) { // Expected exception. } } @Test public void test00499() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00499"); org.elasticsearch.index.query.SimpleIndexQueryParserTests simpleIndexQueryParserTests0 = new org.elasticsearch.index.query.SimpleIndexQueryParserTests(); simpleIndexQueryParserTests0.overrideTestDefaultQueryCache(); org.apache.lucene.index.IndexReader indexReader3 = null; org.apache.lucene.index.Fields fields4 = null; org.apache.lucene.index.Fields fields5 = null; simpleIndexQueryParserTests0.assertFieldsEquals("tests.failfast", indexReader3, fields4, fields5, false); org.junit.rules.RuleChain ruleChain8 = simpleIndexQueryParserTests0.failureAndSuccessEvents; simpleIndexQueryParserTests0.ensureCleanedUp(); // The following exception was thrown during execution in test generation try { simpleIndexQueryParserTests0.testQueryStringFields2(); org.junit.Assert.fail("Expected exception of type java.io.FileNotFoundException; message: Resource [/org/elasticsearch/index/query/query-fields2.json] not found in classpath"); } catch (java.io.FileNotFoundException e) { // Expected exception. } org.junit.Assert.assertNotNull(ruleChain8); } @Test public void test00500() throws Throwable { if (debug) System.out.format("%n%s%n", "RegressionTest0.test00500"); // The following exception was thrown during execution in test generation try { org.apache.lucene.index.MergePolicy mergePolicy1 = org.apache.lucene.util.LuceneTestCase.newLogMergePolicy(0); org.junit.Assert.fail("Expected exception of type java.lang.IllegalStateException; message: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class) to your test class. Make sure your code accesses random contexts within @BeforeClass and @AfterClass boundary (for example, static test class initializers are not permitted to access random contexts)."); } catch (java.lang.IllegalStateException e) { // Expected exception. } } }
9244ed54f373cd760b03e4567a53d24cd3c3e192
1,902
java
Java
Rest-Lgoin-Token/src/main/java/com/yisa/REST/Login/authorization/interceptor/AuthorizationInterceptor.java
Yisaer/Springboot-REST-Login
d0ce73bccc8cbb8ef6556d2e3092e054527c22d2
[ "MIT" ]
null
null
null
Rest-Lgoin-Token/src/main/java/com/yisa/REST/Login/authorization/interceptor/AuthorizationInterceptor.java
Yisaer/Springboot-REST-Login
d0ce73bccc8cbb8ef6556d2e3092e054527c22d2
[ "MIT" ]
null
null
null
Rest-Lgoin-Token/src/main/java/com/yisa/REST/Login/authorization/interceptor/AuthorizationInterceptor.java
Yisaer/Springboot-REST-Login
d0ce73bccc8cbb8ef6556d2e3092e054527c22d2
[ "MIT" ]
null
null
null
32.237288
121
0.683491
1,003,188
package com.yisa.REST.Login.authorization.interceptor; import com.yisa.REST.Login.authorization.annotation.Authorization; import com.yisa.REST.Login.authorization.config.Constants; import com.yisa.REST.Login.authorization.manager.TokenManager; import com.yisa.REST.Login.authorization.model.TokenModel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.lang.reflect.Method; @Component public class AuthorizationInterceptor extends HandlerInterceptorAdapter { @Autowired private TokenManager manager; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { /** * 如果不是映射到方法的则直接通过 */ if( ! ( handler instanceof HandlerMethod)){ return true; } HandlerMethod handlerMethod = (HandlerMethod) handler; Method method = handlerMethod.getMethod(); /** * 从header中得到token */ String authorization = request.getHeader(Constants.AUTHORIZATION); /** * 验证token */ TokenModel model = manager.getToken(authorization); if( manager.checkToken(model)){ /** * 验证成功,将token对应的用户id存在request中,便于之后注入 */ request.setAttribute(Constants.CURRENT_USER_ID,model.getUserId()); return true; } /** * 验证失败 */ if( method.getAnnotation(Authorization.class) != null ){ response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return false; } return true; } }
9244eda3934eed059966d143d761a1c45eab2bb0
900
java
Java
src/main/java/br/com/zupacademy/adriano/mercadolivre/controllers/dto/PagSeguroDto.java
AdrianoAnunciacao98/orange-talents-07-template-ecommerce
cbe11679869060728afb56e313283a1e9b12a6bd
[ "Apache-2.0" ]
null
null
null
src/main/java/br/com/zupacademy/adriano/mercadolivre/controllers/dto/PagSeguroDto.java
AdrianoAnunciacao98/orange-talents-07-template-ecommerce
cbe11679869060728afb56e313283a1e9b12a6bd
[ "Apache-2.0" ]
null
null
null
src/main/java/br/com/zupacademy/adriano/mercadolivre/controllers/dto/PagSeguroDto.java
AdrianoAnunciacao98/orange-talents-07-template-ecommerce
cbe11679869060728afb56e313283a1e9b12a6bd
[ "Apache-2.0" ]
null
null
null
33.333333
86
0.792222
1,003,189
package br.com.zupacademy.adriano.mercadolivre.controllers.dto; import br.com.zupacademy.adriano.mercadolivre.entidades.Compra; import br.com.zupacademy.adriano.mercadolivre.entidades.Transacao; import br.com.zupacademy.adriano.mercadolivre.utils.RetornoGatewayPagamento; import br.com.zupacademy.adriano.mercadolivre.utils.StatusRetornoPagseguro; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; public class PagSeguroDto implements RetornoGatewayPagamento { @NotBlank private String idTransacao; @NotNull private StatusRetornoPagseguro status; public PagSeguroDto(@NotBlank String idTransacao, StatusRetornoPagseguro status) { this.idTransacao = idTransacao; this.status = status; } public Transacao toTransacao(Compra compra) { return new Transacao(status.normaliza(),idTransacao,compra); } }
9244eeb63de8cecc850b97ec7a8f48d2d421237d
369
java
Java
purchaseoffer-service/src/main/java/de/appblocks/microservice/purchaseoffer/MicroservicePurchaseOfferApplication.java
fabapp/priceoffers
75b49c91e22fa3ffe7832c2b9632872a04d25909
[ "Apache-2.0" ]
null
null
null
purchaseoffer-service/src/main/java/de/appblocks/microservice/purchaseoffer/MicroservicePurchaseOfferApplication.java
fabapp/priceoffers
75b49c91e22fa3ffe7832c2b9632872a04d25909
[ "Apache-2.0" ]
null
null
null
purchaseoffer-service/src/main/java/de/appblocks/microservice/purchaseoffer/MicroservicePurchaseOfferApplication.java
fabapp/priceoffers
75b49c91e22fa3ffe7832c2b9632872a04d25909
[ "Apache-2.0" ]
null
null
null
28.384615
74
0.848238
1,003,190
package de.appblocks.microservice.purchaseoffer; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class MicroservicePurchaseOfferApplication { public static void main(String[] args) { SpringApplication.run(MicroservicePurchaseOfferApplication.class, args); } }
9244ef077891abe2dd187b4a43df73f58976c47e
12,461
java
Java
imagej_plugins/Hex_Symmetry.java
Brow71189/low-dose-reconstruction
927d1393f351eba45778e03d12acdde316907ecf
[ "MIT" ]
null
null
null
imagej_plugins/Hex_Symmetry.java
Brow71189/low-dose-reconstruction
927d1393f351eba45778e03d12acdde316907ecf
[ "MIT" ]
null
null
null
imagej_plugins/Hex_Symmetry.java
Brow71189/low-dose-reconstruction
927d1393f351eba45778e03d12acdde316907ecf
[ "MIT" ]
null
null
null
23.422932
120
0.602199
1,003,191
import ij.*; import ij.IJ; import ij.ImagePlus; import ij.gui.*; import ij.gui.GenericDialog; import ij.plugin.*; import java.util.Random; public class Hex_Symmetry implements PlugIn { int Mx,Mz; int subframesize; int[] lpX = null; int[] lpZ = null; int[] hexPixels = null; int[] latticePoints = null; int hpMax = 1; int lpMax = 1; int bondlength = 4; int subframeCount =1; int current_subframesize = -1; int current_bondlength = -1; int grayvalues = 64; String Inputtitle = WindowManager.getCurrentImage().getTitle(); //the lattice String Outputtitle = WindowManager.makeUniqueName("Hex_Symmetry.tif"); //the output public ImagePlus InputImg = null; public ImagePlus OutputImg = null; int firstframe = 1; int lastframe = -1; boolean quit_after_generation = false; boolean detached = false; boolean calculate_median = false; boolean show_median = false; boolean subtract_median = false; private short[][] full_histo = null; public short[] median = null; //needed by calling Diff_Matcher public Hex_Symmetry() {} public Hex_Symmetry(int _firstframe, int _lastframe, int _subframesize, int _bondlength, int _grayvalues, ImagePlus _InputImg) { detached = true; InputImg = _InputImg; firstframe = _firstframe; lastframe = _lastframe; subframesize = _subframesize; bondlength = _bondlength; grayvalues = _grayvalues; current_subframesize = _subframesize; current_bondlength = _bondlength; if(grayvalues > 1) { calculate_median = true; show_median = false; subtract_median = true; } if(validateInput() < 2) { init_transformations();} else { System.out.println("ERROR in Hex_Symmetry::Hex_Symmetry(int, int, int, int, ImagePlus)"); } //IJ.log("new Hex_Symmetry instantiated"); //IJ.log(InputImg.getTitle() + " first_frame: " + firstframe + " last_frame: " + lastframe); //IJ.log("hidden " OutputImg.getTitle() + " frames: " + OutputImg.getStackSize()); /* After constructing every call of apply_transformations() * will update OutputImg from the current state of the * input image */ } public void run( String arg) { IJ.register(getClass()); do { int res = 0; do { if(!setupDialog()) { return;} res = validateInput(); if(res > 1) { IJ.error("bad input! Better luck next time");} } while (res > 1); if(res > 1) { IJ.log("Hex_Symetry: input was autocorrected");} if( (current_bondlength != bondlength) || (current_subframesize != subframesize) ) { init_transformations(); } apply_transformations(); OutputImg.show(); OutputImg.updateAndRepaintWindow(); } while(!quit_after_generation); } public void apply_transformations() { if(calculate_median) { full_histo = new short[subframesize * subframesize][grayvalues]; //reset all median = new short[subframesize * subframesize]; //reset all } else { full_histo = null; median = null; } int oust = 1; ImageStack inputSt = InputImg.getStack(); ImageStack outputSt = OutputImg.getStack(); int prog_step = subframeCount/100; for(int inst = firstframe; inst <= lastframe; ++inst) { short [] inpixels = (short[])inputSt.getPixels(inst); for(int mirror = 0; mirror < 2; ++mirror) { for(int rot = 0; rot < 6; ++rot) { for(int lp = 0; lp < lpMax; ++lp) // go over all 6-rings in the hex_domain { if(!detached && (prog_step != 0) && oust%prog_step == 0) { IJ.showProgress(oust, subframeCount); } short[] outpixels = (short[])outputSt.getPixels(oust++); for(int hp = 0; hp < hpMax; ++hp) //go over all pixels inside hex_domain { int ind_i = hexPixels[hp]; int q_i = ind_i % subframesize; int r_i = ind_i / subframesize; int ind_o = transform_qr(q_i, r_i, lp, rot, mirror); outpixels[ind_o] = inpixels[ind_i]; if(calculate_median) { ++full_histo[ind_o][inpixels[ind_i]]; } } } } } } if(!detached) { IJ.showProgress(1.0);} if(calculate_median) { final int limit = subframeCount/2; for(int hp = 0; hp < hpMax; ++hp) //go over all pixels inside hex_domain { int ind_i = hexPixels[hp]; short[] histo = full_histo[ind_i]; int sum = 0; int val = 0; while(sum < limit) { sum += histo[val++]; } median[ind_i] = (short)val; } if(subtract_median) { final int area = subframesize * subframesize; for(int sl = 1; sl <= subframeCount; ++sl) { short[] outpixels = (short[])outputSt.getPixels(sl); for(int ind = 0; ind < area; ++ind) //25% will be both zero { outpixels[ind] += (short)(32768 - median[ind]); } } } if(show_median) { ImageStack med_St = ImageStack.create(subframesize,subframesize,1,16); med_St.setPixels(median,1); ImagePlus med_Img = new ImagePlus(WindowManager.makeUniqueName("MED_" + Outputtitle) , med_St); med_Img.show(); } } //release the arrays to GarbageCollector full_histo = null; } //show Dialog and read all the input private boolean setupDialog() { NonBlockingGenericDialog gd = new NonBlockingGenericDialog("Hex_Symmetry"); int[] idArray = WindowManager.getIDList(); // list of all opened images (IDs) if (idArray == null) { IJ.noImage(); return false; } Outputtitle = WindowManager.makeUniqueName(Outputtitle); // dont overrite previous output String[] titleArray = new String[idArray.length]; // titles of opened images for (int i = 0; i < idArray.length; ++i) { titleArray[i] = WindowManager.getImage(idArray[i]).getTitle(); } if (Inputtitle == null || Inputtitle.equals("")) { Inputtitle = titleArray[titleArray.length-1];} //the most recent image gd.addMessage("The output will be a stack of all possible\n" + "graphene lattice symetry operations.\n" + "The ordering is Tx,Tz,R,M,frames"); gd.addChoice("Source Image/Stack (GRAY16)", titleArray, Inputtitle ); gd.addNumericField("First frame to process", firstframe, 0); gd.addNumericField("Last frame to process (<1 End)", lastframe, 0); gd.addNumericField("bondlength",bondlength,0); gd.addNumericField("grayvalues (<2 no median)", grayvalues,0); gd.addStringField("Output", Outputtitle, 30); gd.addCheckbox("calculate median", calculate_median); gd.addCheckbox("subtract median", subtract_median); gd.addCheckbox("show median", show_median); gd.addCheckbox("Quit after generation", quit_after_generation); gd.showDialog(); if (gd.wasCanceled()) { return false; } Inputtitle = gd.getNextChoice(); firstframe = (int)gd.getNextNumber(); lastframe = (int)gd.getNextNumber(); bondlength = (int)gd.getNextNumber(); grayvalues = (int)gd.getNextNumber(); Outputtitle = WindowManager.makeUniqueName(gd.getNextString()); calculate_median = gd.getNextBoolean(); subtract_median = gd.getNextBoolean(); show_median = gd.getNextBoolean(); quit_after_generation = gd.getNextBoolean(); return true; } // 0 .. ok , 1 .. minor issue, 2 .. bad case private int validateInput() { int res = 0; // result code if(bondlength < 0) { res = 1; bondlength = -bondlength; } /* else if(bondlength == 0) { IJ.log("bondlength cannot be 0"); res = 0; } */ if(!detached) { InputImg = WindowManager.getImage(Inputtitle); } if( (InputImg.getType() != ImagePlus.GRAY16) ) { res = 2; IJ.log("Please provide a GRAY16 formated version of " + Inputtitle); } subframesize = InputImg.getWidth(); //actually diameter if( (subframesize%2 != 0) || (subframesize != InputImg.getHeight()) ) { IJ.log(Inputtitle + "must be a square with even edge lengths"); res = 2; } if ( (bondlength != 0) && ( (subframesize/2) % bondlength != 0) ) { IJ.log("make sure that radius % bondlength == 0"); res = 2; } hpMax = ( 3 * subframesize * subframesize) / 4; // pixels per hex domain if(bondlength != 0) { lpMax = ( subframesize * subframesize) / ( 4 * bondlength * bondlength ); // number of 6-rings per hex domain } if(firstframe > lastframe && lastframe > 0) { int tmp = lastframe; lastframe = firstframe; firstframe = tmp; } if(firstframe < 1) { firstframe = 1; } if( (lastframe < 1) || (lastframe > InputImg.getStackSize()) ) { lastframe = InputImg.getStackSize(); } subframeCount = lpMax * 12 * (lastframe - firstframe + 1); if(grayvalues < 2) { calculate_median = false; } if(!calculate_median && (subtract_median || show_median) ) { subtract_median = false; show_median = false; IJ.log("cannot subtract or show median from "+ grayvalues +" grayvalues"); res = 2; } if(calculate_median && !subtract_median && !show_median) { calculate_median = false; res = 1; } if(res < 2) // no really bad input so far, skip if not needed { OutputImg = NewImage.createShortImage(Outputtitle, subframesize , subframesize, subframeCount , NewImage.FILL_BLACK); } return res; } private void init_transformations() { current_subframesize = subframesize; current_bondlength = bondlength; //prefetch the equivalent lattice sites inside the hex subframe final int rH = subframesize/2; hexPixels = new int[hpMax]; latticePoints = new int[lpMax]; lpX = new int[lpMax]; lpZ = new int[lpMax]; int hpC = (0); int lpC = (0); //odd-r -> cube Mx = rH - (rH) / 2; Mz = rH; for(int dx = -rH; dx < rH ; ++dx) { int dz1 = -rH; int dz2 = rH - dx; if (dx < 0) { dz1 = -rH - dx; dz2 = rH; } for(int dz = dz1; dz < dz2; ++dz) { int dy = -dx - dz; //translate to center int x_data = dx + Mx; int z_data = dz + Mz; // cube -> odd-r int q_data = x_data + (z_data-(z_data&1)) / 2; int r_data = z_data; int ind = q_data + r_data * subframesize; hexPixels[hpC++] = ind; } } int dim = (bondlength > 0 )? subframesize/(2*bondlength) : 1; for(int stepz = 0 ; stepz < dim; ++stepz) { for(int stepx = 0 ; stepx < dim; ++stepx) { int dx = bondlength*(2*stepx-stepz); int dz = bondlength*(2*stepz-stepx); int dy = -dx -dz; int[] cube = {dx,dy,dz}; hexagonal_trap(cube,rH); dx = cube[0]; dy = cube[1]; dz = cube[2]; //translate to center int x_data = dx + Mx; int z_data = dz + Mz; // cube -> odd-r int q_data = x_data + (z_data) / 2; int ind = q_data + z_data * subframesize; //z_data = r_data lpX[lpC] = dx; lpZ[lpC] = dz; latticePoints[lpC++] = ind; } } } private int transform_qr(int q, int r, int lp, int rot, int mirror) { //odd-r -> cube int x = (q - (r-(r&1))/2 ); int z = (r); //offset around center int xs = (x - Mx); int zs = (z - Mz); //translation by lattice point final int xt = ( lpX[lp] ); final int zt = ( lpZ[lp] ); xs += xt; zs += zt; int ys = (-xs - zs); //rotation if(rot > 0) { int[] rotxyz = {xs, ys, zs}; xs = rotxyz[rot % 3]; ys = rotxyz[(1+rot) % 3]; if( (rot&1) == 1) //odd number { xs = -xs; ys = -ys; } zs = (-xs - ys); } //mirroring if( (mirror&1) == 1) { zs = ys; ys = (-xs - zs); } //periodic hexagon int[] cube = {xs, ys, zs}; hexagonal_trap(cube, Mz); //undo offset by center xs = cube[0] + Mx; zs = cube[2] + Mz; int qt = xs + (zs)/2; return (qt + zs * subframesize); //zs = rt } private boolean hexagonal_trap(int[] cube, int N) { int lx = cube[0]; int ly = cube[1]; int lz = cube[2]; boolean at_home = true; //apply periodic boundary conditions int runs = 0; do { at_home = true; if(lx >= N) { at_home = false; lx -= (2*N); ly -= (-N); lz -= (-N); } else if (lx < -N) { at_home = false; lx += (2*N); ly += (-N); lz += (-N); } if(ly > N) { at_home = false; lx -= (-N); ly -= (2*N); lz -= (-N); } else if (ly <= -N) { at_home = false; lx += (-N); ly += (2*N); lz += (-N); } if(lz >= N) { lx -= (-N); ly -= (-N); lz -= (2*N); } else if (lz < -N) { lx += (-N); ly += (-N); lz += (2*N); } ++runs; } while (!at_home); cube[0] = lx; cube[1] = ly; cube[2] = lz; return (runs == 1); } }
9244f01af2631f9e9369690b364ce8310ae764ba
2,890
java
Java
src/main/java/com/tencent/ads/model/WechatAdBehavior.java
TencentAd/marketing-api-java-sdk
773c97bc9617c31846011920a15ae2e2f67087b2
[ "Apache-2.0" ]
23
2020-09-28T07:54:20.000Z
2022-02-22T03:15:12.000Z
src/main/java/com/tencent/ads/model/WechatAdBehavior.java
TencentAd/marketing-api-java-sdk
773c97bc9617c31846011920a15ae2e2f67087b2
[ "Apache-2.0" ]
6
2020-11-04T02:38:09.000Z
2021-11-10T02:36:00.000Z
src/main/java/com/tencent/ads/model/WechatAdBehavior.java
TencentAd/marketing-api-java-sdk
773c97bc9617c31846011920a15ae2e2f67087b2
[ "Apache-2.0" ]
10
2021-01-28T09:04:55.000Z
2022-03-07T12:15:44.000Z
24.083333
100
0.687889
1,003,192
/* * Marketing API * Marketing API * * OpenAPI spec version: 1.3 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.tencent.ads.model; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** 微信再营销,原微信广告行为定向升级为微信再营销 */ @ApiModel(description = "微信再营销,原微信广告行为定向升级为微信再营销") public class WechatAdBehavior { @SerializedName("actions") private List<String> actions = null; @SerializedName("excluded_actions") private List<String> excludedActions = null; public WechatAdBehavior actions(List<String> actions) { this.actions = actions; return this; } public WechatAdBehavior addActionsItem(String actionsItem) { if (this.actions == null) { this.actions = new ArrayList<String>(); } this.actions.add(actionsItem); return this; } /** * Get actions * * @return actions */ @ApiModelProperty(value = "") public List<String> getActions() { return actions; } public void setActions(List<String> actions) { this.actions = actions; } public WechatAdBehavior excludedActions(List<String> excludedActions) { this.excludedActions = excludedActions; return this; } public WechatAdBehavior addExcludedActionsItem(String excludedActionsItem) { if (this.excludedActions == null) { this.excludedActions = new ArrayList<String>(); } this.excludedActions.add(excludedActionsItem); return this; } /** * Get excludedActions * * @return excludedActions */ @ApiModelProperty(value = "") public List<String> getExcludedActions() { return excludedActions; } public void setExcludedActions(List<String> excludedActions) { this.excludedActions = excludedActions; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } WechatAdBehavior wechatAdBehavior = (WechatAdBehavior) o; return Objects.equals(this.actions, wechatAdBehavior.actions) && Objects.equals(this.excludedActions, wechatAdBehavior.excludedActions); } @Override public int hashCode() { return Objects.hash(actions, excludedActions); } @Override public String toString() { Gson gson = new Gson(); return gson.toJson(this); } /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
9244f237e17e2644d6d8d92675f7cb8dc9692b57
8,243
java
Java
src/main/java/com/binance/dex/api/client/encoding/message/sidechain/query/BechValidator.java
dogenkigen/java-sdk
5b332f7f5f20a95ee088411f94d28aaf6c024162
[ "Apache-2.0" ]
102
2019-02-10T16:34:38.000Z
2022-01-23T21:35:30.000Z
src/main/java/com/binance/dex/api/client/encoding/message/sidechain/query/BechValidator.java
dogenkigen/java-sdk
5b332f7f5f20a95ee088411f94d28aaf6c024162
[ "Apache-2.0" ]
47
2019-03-04T05:55:49.000Z
2022-02-14T02:58:56.000Z
src/main/java/com/binance/dex/api/client/encoding/message/sidechain/query/BechValidator.java
dogenkigen/java-sdk
5b332f7f5f20a95ee088411f94d28aaf6c024162
[ "Apache-2.0" ]
70
2019-02-10T16:34:29.000Z
2022-01-05T07:10:58.000Z
26.003155
98
0.644426
1,003,193
package com.binance.dex.api.client.encoding.message.sidechain.query; import com.binance.dex.api.client.domain.stake.Commission; import com.binance.dex.api.client.domain.stake.Description; import com.binance.dex.api.client.domain.stake.sidechain.SideChainValidator; import com.binance.dex.api.client.encoding.Crypto; import com.binance.dex.api.client.encoding.amino.Amino; import com.binance.dex.api.client.encoding.message.sidechain.value.DescriptionValue; import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.commons.lang3.StringUtils; /** * @author Fitz.Lu **/ public class BechValidator { static class CommissionForDecode { @JsonProperty(value = "rate") private long rate; @JsonProperty(value = "max_rate") private long maxRate; @JsonProperty(value = "max_change_rate") private long maxChangeRate; @JsonProperty(value = "update_time") private String updateTime; public CommissionForDecode() { } public long getRate() { return rate; } public void setRate(long rate) { this.rate = rate; } public long getMaxRate() { return maxRate; } public void setMaxRate(long maxRate) { this.maxRate = maxRate; } public long getMaxChangeRate() { return maxChangeRate; } public void setMaxChangeRate(long maxChangeRate) { this.maxChangeRate = maxChangeRate; } public String getUpdateTime() { return updateTime; } public void setUpdateTime(String updateTime) { this.updateTime = updateTime; } } @JsonProperty(value = "fee_addr") private String feeAddr; @JsonProperty(value = "operator_address") private String operatorAddr; @JsonProperty(value = "consensus_pubkey") private String consPubKey; @JsonProperty(value = "jailed") private boolean jailed; @JsonProperty(value = "status") private int status; @JsonProperty(value = "tokens") private long tokens; @JsonProperty(value = "delegator_shares") private long delegatorShares; @JsonProperty(value = "description") private DescriptionValue description; @JsonProperty(value = "bond_height") private long bondHeight; @JsonProperty(value = "bond_intra_tx_counter") private int bondIntraTxCounter; @JsonProperty(value = "unbonding_height") private long unBondingHeight; @JsonProperty(value = "unbonding_time") private String unBondingMinTime; @JsonProperty(value = "commission") private CommissionForDecode commission; @JsonProperty(value = "distribution_addr") private String distributionAddr; @JsonProperty(value = "side_chain_id") private String sideChainId; @JsonProperty(value = "side_cons_addr") private String sideConsAddr; @JsonProperty(value = "side_fee_addr") private String sideFeeAddr; public BechValidator() { } public SideChainValidator toSideChainValidator() { SideChainValidator validator = new SideChainValidator(); if (feeAddr != null) { validator.setFeeAddr(feeAddr); } if (operatorAddr != null) { validator.setOperatorAddr(operatorAddr); } if (consPubKey != null) { try { validator.setConsPubKey(Amino.getByteArrayAfterTypePrefix(consPubKey.getBytes())); }catch (IllegalStateException e){ validator.setConsPubKey(consPubKey.getBytes()); } } validator.setJailed(jailed); validator.setStatus(status); validator.setTokens(tokens); validator.setDelegatorShares(delegatorShares); Description descript = new Description(); if (description != null) { descript.setMoniker(description.getMoniker()); descript.setWebsite(description.getWebsite()); descript.setDetails(description.getDetails()); descript.setIdentity(description.getIdentity()); } validator.setDescription(descript); validator.setBondHeight(bondHeight); validator.setBondIntraTxCounter(bondIntraTxCounter); validator.setUnBondingHeight(unBondingHeight); // validator.setUnBondingMinTime(unBondingMinTime); Commission comm = new Commission(); if (commission != null) { comm.setRate(commission.getRate()); comm.setMaxRate(commission.getMaxRate()); comm.setMaxChangeRate(commission.getMaxChangeRate()); // comm.setUpdateTimeInMs(commission.getUpdateTime()); } validator.setCommission(comm); if (!StringUtils.isEmpty(sideChainId)) { if (distributionAddr != null) { validator.setDistributionAddr(distributionAddr); } validator.setSideChainId(sideChainId); if (sideConsAddr != null) { validator.setSideConsAddr(sideConsAddr); } if (sideFeeAddr != null) { validator.setSideFeeAddr(sideFeeAddr); } } return validator; } public String getConsPubKey() { return consPubKey; } public void setConsPubKey(String consPubKey) { this.consPubKey = consPubKey; } public boolean isJailed() { return jailed; } public void setJailed(boolean jailed) { this.jailed = jailed; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public long getTokens() { return tokens; } public void setTokens(long tokens) { this.tokens = tokens; } public long getDelegatorShares() { return delegatorShares; } public void setDelegatorShares(long delegatorShares) { this.delegatorShares = delegatorShares; } public long getBondHeight() { return bondHeight; } public void setBondHeight(long bondHeight) { this.bondHeight = bondHeight; } public int getBondIntraTxCounter() { return bondIntraTxCounter; } public void setBondIntraTxCounter(int bondIntraTxCounter) { this.bondIntraTxCounter = bondIntraTxCounter; } public long getUnBondingHeight() { return unBondingHeight; } public void setUnBondingHeight(long unBondingHeight) { this.unBondingHeight = unBondingHeight; } public String getUnBondingMinTime() { return unBondingMinTime; } public void setUnBondingMinTime(String unBondingMinTime) { this.unBondingMinTime = unBondingMinTime; } public DescriptionValue getDescription() { return description; } public void setDescription(DescriptionValue description) { this.description = description; } public CommissionForDecode getCommission() { return commission; } public void setCommission(CommissionForDecode commission) { this.commission = commission; } public String getSideChainId() { return sideChainId; } public void setSideChainId(String sideChainId) { this.sideChainId = sideChainId; } public String getSideConsAddr() { return sideConsAddr; } public void setSideConsAddr(String sideConsAddr) { this.sideConsAddr = sideConsAddr; } public String getSideFeeAddr() { return sideFeeAddr; } public void setSideFeeAddr(String sideFeeAddr) { this.sideFeeAddr = sideFeeAddr; } public String getFeeAddr() { return feeAddr; } public void setFeeAddr(String feeAddr) { this.feeAddr = feeAddr; } public String getOperatorAddr() { return operatorAddr; } public void setOperatorAddr(String operatorAddr) { this.operatorAddr = operatorAddr; } public String getDistributionAddr() { return distributionAddr; } public void setDistributionAddr(String distributionAddr) { this.distributionAddr = distributionAddr; } }
9244f36ccb401480cc2c78aa1a9e3a4924068996
2,631
java
Java
app/src/main/java/ca/itinerum/android/utilities/db/PromptDao.java
TRIP-Lab/itinerum-android
2f65637812b0c7511e886a32d81a56ef91b32c73
[ "MIT" ]
6
2018-03-23T22:20:50.000Z
2021-07-17T19:52:52.000Z
app/src/main/java/ca/itinerum/android/utilities/db/PromptDao.java
TRIP-Lab/itinerum-android
2f65637812b0c7511e886a32d81a56ef91b32c73
[ "MIT" ]
null
null
null
app/src/main/java/ca/itinerum/android/utilities/db/PromptDao.java
TRIP-Lab/itinerum-android
2f65637812b0c7511e886a32d81a56ef91b32c73
[ "MIT" ]
1
2020-10-31T20:08:41.000Z
2020-10-31T20:08:41.000Z
34.618421
130
0.760167
1,003,194
package ca.itinerum.android.utilities.db; import android.arch.persistence.room.Dao; import android.arch.persistence.room.Delete; import android.arch.persistence.room.Insert; import android.arch.persistence.room.OnConflictStrategy; import android.arch.persistence.room.Query; import android.arch.persistence.room.Update; import java.util.List; import ca.itinerum.android.sync.retrofit.PromptAnswer; import io.reactivex.Flowable; @Dao public interface PromptDao { @Insert(onConflict = OnConflictStrategy.REPLACE) void insert(PromptAnswer... promptAnswers); @Update void update(PromptAnswer... promptAnswers); @Query("SELECT * FROM prompts") List<PromptAnswer> getAllPromptAnswers(); /** * * @return a list of PromptAnswer objects that weren't cancelled */ @Query("SELECT * FROM prompts WHERE cancelled = '0'") List<PromptAnswer> getAllRegisteredPromptAnswers(); @Query("SELECT * FROM prompts WHERE cancelled = '0' AND user_defined = '0'") List<PromptAnswer> getAllAutomaticPromptAnswers(); /** Count the number of automatically answered prompts. NOTE: this is total and should be divided by the number of actual prompts * * @return Number of automatically answered prompts */ @Query("SELECT COUNT(*) FROM prompts WHERE cancelled = '0' AND user_defined = '0'") int getAllAutomaticPromptAnswersCount(); /** * * @param fromDate * @param toDate * @return a Flowable containing a list of PromptAnswer objects that weren't cancelled and aren't user defined */ @Query("SELECT * FROM prompts WHERE :fromDate < recorded_at AND recorded_at < :toDate AND cancelled = '0'") Flowable<List<PromptAnswer>> getAllRegisteredPromptAnswersFlowable(String fromDate, String toDate); @Query("SELECT * FROM prompts WHERE cancelled = '0' AND user_defined = '0'") Flowable<List<PromptAnswer>> getAllAutomaticPromptAnswersFlowable(); @Query("SELECT * FROM prompts WHERE :fromDate < recorded_at AND recorded_at < :toDate") Flowable<List<PromptAnswer>> getAllPromptAnswersFlowable(String fromDate, String toDate); @Query("SELECT * FROM prompts WHERE uploaded = '0' AND cancelled = '0'") List<PromptAnswer> getAllUnsyncedRegisteredPromptAnswers(); @Query("SELECT * FROM prompts WHERE uploaded = '0' AND cancelled = '1'") List<PromptAnswer> getAllUnsyncedCancelledPromptAnswers(); @Query("SELECT * FROM prompts WHERE cancelled = '0' AND user_defined = '0' ORDER BY _id DESC LIMIT 1") PromptAnswer getLastPromptAnswer(); @Query("SELECT COUNT() FROM prompts") int getCount(); @Delete void deletePromptAnswers(PromptAnswer... promptAnswers); @Query("DELETE FROM prompts") void nukeTable(); }
9244f4ceeed5fdddf097a6ccfddc25f6628c4095
1,816
java
Java
src/test/java/de/jaggl/sqlbuilder/core/columns/number/doubletype/DoubleColumnTest.java
de-jaggl/sqlbuilder
d2b3ddeaf22f8d71f861723424100f388e4cbdbe
[ "MIT" ]
6
2020-01-01T20:26:35.000Z
2021-09-06T12:14:39.000Z
src/test/java/de/jaggl/sqlbuilder/core/columns/number/doubletype/DoubleColumnTest.java
de-jaggl/sqlbuilder
d2b3ddeaf22f8d71f861723424100f388e4cbdbe
[ "MIT" ]
14
2020-01-04T19:21:00.000Z
2020-08-26T09:57:27.000Z
src/test/java/de/jaggl/sqlbuilder/core/columns/number/doubletype/DoubleColumnTest.java
de-jaggl/sqlbuilder
d2b3ddeaf22f8d71f861723424100f388e4cbdbe
[ "MIT" ]
null
null
null
44.292683
145
0.738987
1,003,195
package de.jaggl.sqlbuilder.core.columns.number.doubletype; import java.util.function.BiFunction; import org.junit.jupiter.api.Test; import de.jaggl.sqlbuilder.core.columns.number.doubletype.DoubleColumn; import de.jaggl.sqlbuilder.core.columns.number.doubletype.DoubleColumnBuilder; import de.jaggl.sqlbuilder.core.schema.Table; import de.jaggl.sqlbuilder.core.testsupport.ColumnAliasTestSupport; import de.jaggl.sqlbuilder.core.testsupport.Consumers; class DoubleColumnTest extends DoubleTypeColumnTest<DoubleColumn, DoubleColumnBuilder> implements ColumnAliasTestSupport<DoubleColumn, DoubleColumnBuilder, Double> { @Override public DoubleColumnBuilder getColumnBuilder(Table table, String name) { return new DoubleColumnBuilder(table, name); } @Override public BiFunction<DoubleColumn, String, DoubleColumn> getAliasFunction() { return (column, alias) -> column.as(alias); } @Test void testDecimalColumnDefinition() { assertBuild(Consumers::noAction).isEqualTo("DOUBLE DEFAULT NULL"); assertBuild(builder -> builder.notNull()).isEqualTo("DOUBLE NOT NULL"); assertBuild(builder -> builder.defaultNull()).isEqualTo("DOUBLE DEFAULT NULL"); assertBuild(builder -> builder.noDefault()).isEqualTo("DOUBLE"); assertBuild(builder -> builder.size(3.3).defaultNull()).isEqualTo("DOUBLE(3,3) DEFAULT NULL"); assertBuild(builder -> builder.size(3.3).defaultValue(123.123)).isEqualTo("DOUBLE(3,3) DEFAULT 123.123"); assertBuild(builder -> builder.size(Double.valueOf(3.3)).defaultValue(Double.valueOf(123.123))).isEqualTo("DOUBLE(3,3) DEFAULT 123.123"); assertBuild(builder -> builder.size(3.3).notNull().defaultValue(123.123)).isEqualTo("DOUBLE(3,3) NOT NULL DEFAULT 123.123"); } }
9244f58d8deeb9913233ede80a4ff35d9a7238e1
2,571
java
Java
linden-core/src/main/java/com/xiaomi/linden/core/search/query/RangeQueryConstructor.java
XiaoMi/linden
8568f4661d98147924e48fd4a4f7079bb57dcac6
[ "Apache-2.0" ]
252
2016-12-22T08:47:59.000Z
2022-02-08T11:17:55.000Z
linden-core/src/main/java/com/xiaomi/linden/core/search/query/RangeQueryConstructor.java
happyapple668/linden
2977cbf7d2feab8bd5803a7dacd02095053edd10
[ "Apache-2.0" ]
7
2017-06-02T06:30:40.000Z
2022-03-28T19:39:20.000Z
linden-core/src/main/java/com/xiaomi/linden/core/search/query/RangeQueryConstructor.java
happyapple668/linden
2977cbf7d2feab8bd5803a7dacd02095053edd10
[ "Apache-2.0" ]
55
2016-12-28T17:04:20.000Z
2021-12-31T03:40:39.000Z
38.373134
118
0.71373
1,003,196
// Copyright 2016 Xiaomi, Inc. // // 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 applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.xiaomi.linden.core.search.query; import java.io.IOException; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermRangeQuery; import com.xiaomi.linden.core.LindenConfig; import com.xiaomi.linden.thrift.common.LindenQuery; import com.xiaomi.linden.thrift.common.LindenRange; import com.xiaomi.linden.thrift.common.LindenRangeQuery; import com.xiaomi.linden.thrift.common.LindenType; public class RangeQueryConstructor extends QueryConstructor { @Override protected Query construct(LindenQuery lindenQuery, LindenConfig config) throws IOException { if (lindenQuery.isSetRangeQuery()) { LindenRangeQuery lindenRangeQuery = lindenQuery.getRangeQuery(); LindenRange range = lindenRangeQuery.getRange(); String fieldName = range.getField(); LindenType type = range.getType(); String start = range.getStartValue(); String end = range.getEndValue(); boolean startClose = range.isStartClosed(); boolean endClose = range.isEndClosed(); Query query = null; switch (type) { case STRING: case FACET: query = new TermRangeQuery(fieldName, bytesRefVal(start), bytesRefVal(end), startClose, endClose); break; case INTEGER: query = NumericRangeQuery.newIntRange(fieldName, intVal(start), intVal(end), startClose, endClose); break; case LONG: query = NumericRangeQuery.newLongRange(fieldName, longVal(start), longVal(end), startClose, endClose); break; case DOUBLE: query = NumericRangeQuery.newDoubleRange(fieldName, doubleVal(start), doubleVal(end), startClose, endClose); break; case FLOAT: query = NumericRangeQuery.newFloatRange(fieldName, floatVal(start), floatVal(end), startClose, endClose); break; } return query; } // todo throw exception. return null; } }
9244f69a05f14f65c56ed138f490567f6befbe5f
578
java
Java
Algorithm/src/main/java/com/leetcode/offer/CQueue.java
huangbin082/Bin
34dc50a1684b23199cfa6517284a6f698c6f910d
[ "Apache-2.0" ]
null
null
null
Algorithm/src/main/java/com/leetcode/offer/CQueue.java
huangbin082/Bin
34dc50a1684b23199cfa6517284a6f698c6f910d
[ "Apache-2.0" ]
5
2021-05-26T15:03:42.000Z
2022-01-04T14:30:13.000Z
Algorithm/src/main/java/com/leetcode/offer/CQueue.java
huangbinme/Bin
6741afde67878cd1e853395817cb9c63e1900e9c
[ "Apache-2.0" ]
null
null
null
19.931034
51
0.541522
1,003,197
package com.leetcode.offer; import java.util.Deque; import java.util.LinkedList; public class CQueue { Deque<Integer> in; Deque<Integer> out; public CQueue() { in = new LinkedList<>(); out = new LinkedList<>(); } public void appendTail(int value) { while (!out.isEmpty()) { in.addLast(out.pollLast()); } in.addLast(value); } public int deleteHead() { while (!in.isEmpty()) { out.addLast(in.pollLast()); } return out.isEmpty() ? -1 : out.pollLast(); } }
9244f7d1cacf87657768adc8e63330b3e544b382
427
java
Java
ezydata-mongodb/src/test/java/com/tvd12/ezydata/mongodb/testing/bean/Duck.java
youngmonkeys/ezydata
29d34e697c3d70a1d738b259715f0a12d343365c
[ "Apache-2.0" ]
2
2021-07-08T14:13:47.000Z
2022-02-27T12:28:12.000Z
ezydata-mongodb/src/test/java/com/tvd12/ezydata/mongodb/testing/bean/Duck.java
tvd12/ezydata
1d5bacb52446d8be901af5e25e8f20d09c6ae2a6
[ "Apache-2.0" ]
4
2021-08-09T20:44:21.000Z
2022-03-05T13:25:30.000Z
ezydata-mongodb/src/test/java/com/tvd12/ezydata/mongodb/testing/bean/Duck.java
youngmonkeys/ezydata
29d34e697c3d70a1d738b259715f0a12d343365c
[ "Apache-2.0" ]
2
2020-01-06T15:22:39.000Z
2021-08-10T07:47:21.000Z
19.409091
60
0.803279
1,003,198
package com.tvd12.ezydata.mongodb.testing.bean; import com.tvd12.ezyfox.database.annotation.EzyCollection; import com.tvd12.ezyfox.database.annotation.EzyCollectionId; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString @EzyCollection("test_mongo_duck") public class Duck { @EzyCollectionId(composite = true) private DuckId id; private int age; private String description; }
9244f96ae9887046bd8e23bc1cd0dadd1110eb73
1,035
java
Java
src/main/java/io/renren/modules/generator/service/impl/WcsWarehouseServiceImpl.java
yxqzjj/renren-fast_wcs
2c3febad63f98654582335d33c98ad7eb4b12b3c
[ "Apache-2.0" ]
null
null
null
src/main/java/io/renren/modules/generator/service/impl/WcsWarehouseServiceImpl.java
yxqzjj/renren-fast_wcs
2c3febad63f98654582335d33c98ad7eb4b12b3c
[ "Apache-2.0" ]
2
2021-04-22T17:02:51.000Z
2021-09-20T20:55:03.000Z
src/main/java/io/renren/modules/generator/service/impl/WcsWarehouseServiceImpl.java
yxqzjj/renren-fast_wcs
2c3febad63f98654582335d33c98ad7eb4b12b3c
[ "Apache-2.0" ]
null
null
null
35.689655
126
0.77971
1,003,199
package io.renren.modules.generator.service.impl; import org.springframework.stereotype.Service; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import io.renren.common.utils.PageUtils; import io.renren.common.utils.Query; import io.renren.modules.generator.dao.WcsWarehouseDao; import io.renren.modules.generator.entity.WcsWarehouseEntity; import io.renren.modules.generator.service.WcsWarehouseService; @Service("wcsWarehouseService") public class WcsWarehouseServiceImpl extends ServiceImpl<WcsWarehouseDao, WcsWarehouseEntity> implements WcsWarehouseService { @Override public PageUtils queryPage(Map<String, Object> params) { IPage<WcsWarehouseEntity> page = this.page( new Query<WcsWarehouseEntity>().getPage(params), new QueryWrapper<WcsWarehouseEntity>() ); return new PageUtils(page); } }
9244f9d301412d6bb9ed778a9208adf5a5fa7429
906
java
Java
initialize/src/main/java/com/bian/debugbox/box/ActivityLifeCycle.java
fhbianling/InitializeUtil
659d6642f5fe65982dd1a29eb9300e53ad0e6f28
[ "Apache-1.1" ]
1
2017-09-09T09:10:28.000Z
2017-09-09T09:10:28.000Z
initialize/src/main/java/com/bian/debugbox/box/ActivityLifeCycle.java
fhbianling/InitializeUtil
659d6642f5fe65982dd1a29eb9300e53ad0e6f28
[ "Apache-1.1" ]
null
null
null
initialize/src/main/java/com/bian/debugbox/box/ActivityLifeCycle.java
fhbianling/InitializeUtil
659d6642f5fe65982dd1a29eb9300e53ad0e6f28
[ "Apache-1.1" ]
null
null
null
18.489796
81
0.711921
1,003,200
package com.bian.debugbox.box; import android.app.Activity; import android.app.Application; import android.os.Bundle; /** * author 边凌 * date 2017/6/8 21:12 * desc ${TODO} */ class ActivityLifeCycle implements Application.ActivityLifecycleCallbacks{ @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { InitializeUtil.inflatedButtonProcess(activity); } @Override public void onActivityStarted(Activity activity) { } @Override public void onActivityResumed(Activity activity) { } @Override public void onActivityPaused(Activity activity) { } @Override public void onActivityStopped(Activity activity) { } @Override public void onActivitySaveInstanceState(Activity activity, Bundle outState) { } @Override public void onActivityDestroyed(Activity activity) { } }
9244fa938b5709b69a1704679e2aaa54db02a53a
627
java
Java
app/src/main/java/ua/in/khol/oleh/touristweathercomparer/model/weather/yahoo/pojo/Astronomy.java
Unikince/WeatherComparator
34a4020785fced32c0215cdf36e78b019523fb97
[ "Apache-2.0" ]
null
null
null
app/src/main/java/ua/in/khol/oleh/touristweathercomparer/model/weather/yahoo/pojo/Astronomy.java
Unikince/WeatherComparator
34a4020785fced32c0215cdf36e78b019523fb97
[ "Apache-2.0" ]
null
null
null
app/src/main/java/ua/in/khol/oleh/touristweathercomparer/model/weather/yahoo/pojo/Astronomy.java
Unikince/WeatherComparator
34a4020785fced32c0215cdf36e78b019523fb97
[ "Apache-2.0" ]
null
null
null
20.225806
72
0.669856
1,003,201
package ua.in.khol.oleh.touristweathercomparer.model.weather.yahoo.pojo; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Astronomy { @SerializedName("sunrise") @Expose private String sunrise; @SerializedName("sunset") @Expose private String sunset; public void setSunrise(String sunrise) { this.sunrise = sunrise; } public String getSunrise() { return sunrise; } public void setSunset(String sunset) { this.sunset = sunset; } public String getSunset() { return sunset; } }
9244fb36d3a26899ac2ace73d62a3c50e99eb65e
3,423
java
Java
src/backend/main/java/com/mitchtalmadge/shillorkill/web/security/SecurityConfiguration.java
MitchTalmadge/CryptoHotOrNot
7990bd0e0fc7323b9695ae9683ab9a3b581e5184
[ "Apache-2.0" ]
3
2018-09-20T01:03:54.000Z
2020-02-13T16:54:18.000Z
src/backend/main/java/com/mitchtalmadge/shillorkill/web/security/SecurityConfiguration.java
MitchTalmadge/CryptoHotOrNot
7990bd0e0fc7323b9695ae9683ab9a3b581e5184
[ "Apache-2.0" ]
2
2017-10-09T23:12:37.000Z
2017-10-10T09:28:12.000Z
src/backend/main/java/com/mitchtalmadge/shillorkill/web/security/SecurityConfiguration.java
MitchTalmadge/CryptoHotOrNot
7990bd0e0fc7323b9695ae9683ab9a3b581e5184
[ "Apache-2.0" ]
1
2018-09-20T01:03:55.000Z
2018-09-20T01:03:55.000Z
38.897727
113
0.708151
1,003,202
/* * Copyright (C) 2016 - 2017 AptiTekk, LLC. (https://AptiTekk.com/) - All Rights Reserved * Unauthorized copying of any part of AptiLink, via any medium, is strictly prohibited. * Proprietary and confidential. */ package com.mitchtalmadge.shillorkill.web.security; import com.mitchtalmadge.shillorkill.web.security.csrf.CSRFCookieFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.web.csrf.CsrfFilter; import org.springframework.security.web.csrf.CsrfTokenRepository; import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) public class SecurityConfiguration extends WebSecurityConfigurerAdapter { private final APIAuthenticationEntryPoint apiAuthenticationEntryPoint; private final CSRFCookieFilter csrfCookieFilter; @Autowired public SecurityConfiguration(APIAuthenticationEntryPoint apiAuthenticationEntryPoint, CSRFCookieFilter csrfCookieFilter) { this.apiAuthenticationEntryPoint = apiAuthenticationEntryPoint; this.csrfCookieFilter = csrfCookieFilter; } @Override protected void configure(HttpSecurity http) throws Exception { http // Add the CSRF Cookie Filter .addFilterAfter(csrfCookieFilter, CsrfFilter.class) // Permit all endpoints. .authorizeRequests() .anyRequest().permitAll() .and() // Disable form login. .formLogin() .disable() // Disable logout endpoint. .logout() .disable() // Disable HTTP Basic authentication .httpBasic() .disable() // Enable CSRF (Cross Site Request Forgery). .csrf() .csrfTokenRepository(generateCSRFTokenRepository()) .and() // Define behavior when an unauthenticated user accesses a secured endpoint. .exceptionHandling() .authenticationEntryPoint(apiAuthenticationEntryPoint); } @Bean @Override public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); } /** * Generates a CSRF Token Repository with a modified header to fit Angular (and other framework) conventions. * * @return The CSRF Token Repository. */ private CsrfTokenRepository generateCSRFTokenRepository() { HttpSessionCsrfTokenRepository tokenRepository = new HttpSessionCsrfTokenRepository(); tokenRepository.setHeaderName("X-XSRF-TOKEN"); return tokenRepository; } }
9244fbff64ac3ea1ab22a9c2ed0f0c25d55e55a4
460
java
Java
src/main/java/com/snaket2003/konnect/backend/consumer/KafkaConsumer.java
snaket2003/konnect
49d049246df2965cb84f3ffedc00cc277de91dfb
[ "Unlicense" ]
null
null
null
src/main/java/com/snaket2003/konnect/backend/consumer/KafkaConsumer.java
snaket2003/konnect
49d049246df2965cb84f3ffedc00cc277de91dfb
[ "Unlicense" ]
5
2021-05-06T15:30:12.000Z
2022-02-19T00:13:15.000Z
src/main/java/com/snaket2003/konnect/backend/consumer/KafkaConsumer.java
snaket2003/konnect
49d049246df2965cb84f3ffedc00cc277de91dfb
[ "Unlicense" ]
null
null
null
28.75
74
0.773913
1,003,203
package com.snaket2003.konnect.backend.consumer; import org.springframework.kafka.annotation.EnableKafka; import org.springframework.kafka.annotation.KafkaListener; import org.springframework.stereotype.Component; @Component @EnableKafka public class KafkaConsumer { @KafkaListener(topics = "quickstart-offsets", groupId = "konnect-app") public void listen(final String message) { System.out.println("Received message: " + message); } }
9244fc20abb5b57e8920b95a0b43289b537f562f
1,124
java
Java
src/model/staff/concrete/PermanentImpl.java
lazokin/Java_StudentRecordSystem
ca97aa342df4ff31ead210467c27b9efaf0fadfe
[ "MIT" ]
1
2016-05-02T22:18:17.000Z
2016-05-02T22:18:17.000Z
src/model/staff/concrete/PermanentImpl.java
lazokin/Java_StudentRecordSystem
ca97aa342df4ff31ead210467c27b9efaf0fadfe
[ "MIT" ]
null
null
null
src/model/staff/concrete/PermanentImpl.java
lazokin/Java_StudentRecordSystem
ca97aa342df4ff31ead210467c27b9efaf0fadfe
[ "MIT" ]
null
null
null
23.914894
81
0.646797
1,003,204
package model.staff.concrete; import model.exceptions.SRSException; import model.staff.Employment; import model.staff.EmploymentType; import model.staff.interfaces.Permanent; import model.staff.interfaces.Staff; /** * The PermanentImpl class represents a concrete permanent employee. * * @author Nikolce Ambukovski, s2008618 * */ public class PermanentImpl extends Employment implements Permanent { int salary; /** * Constructs a new permanent employment object. * * @param staff * A reference to the parent staff object. * @throws SRSException * When the pay is negative. */ public PermanentImpl(Staff staff, int pay) throws SRSException { super(staff); super.employmentType = EmploymentType.Permanent; this.setPay(pay); } @Override public int getPay() { return salary; } @Override public void setPay(int pay) throws SRSException { if (pay < 0) { throw new SRSException("-> Salary cannot be negative. Pay not set."); } this.salary = pay; } }
9244fd12df684bc46ec8ef8696b659ad942376d2
4,577
java
Java
src/test/java/nz/co/gregs/dbvolution/annotations/AutoFillDuringQueryIfPossibleTest.java
gregorydgraham/DBvolution
c0c9a9f05a9f4838dc3426b3726080cb7a29e87f
[ "Apache-2.0" ]
4
2015-06-24T09:18:50.000Z
2021-12-12T11:22:11.000Z
src/test/java/nz/co/gregs/dbvolution/annotations/AutoFillDuringQueryIfPossibleTest.java
gregorydgraham/DBvolution
c0c9a9f05a9f4838dc3426b3726080cb7a29e87f
[ "Apache-2.0" ]
6
2015-06-04T04:09:05.000Z
2022-01-21T23:19:57.000Z
src/test/java/nz/co/gregs/dbvolution/annotations/AutoFillDuringQueryIfPossibleTest.java
gregorydgraham/DBvolution
c0c9a9f05a9f4838dc3426b3726080cb7a29e87f
[ "Apache-2.0" ]
null
null
null
34.156716
107
0.741752
1,003,205
/* * Copyright 2015 gregorygraham. * * 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package nz.co.gregs.dbvolution.annotations; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import nz.co.gregs.dbvolution.DBQuery; import nz.co.gregs.dbvolution.example.CarCompany; import nz.co.gregs.dbvolution.example.Marque; import nz.co.gregs.dbvolution.generic.AbstractTest; import org.junit.Assert; import org.junit.Test; import static org.hamcrest.Matchers.*; /** * * <p style="color: #F90;">Support DBvolution at * <a href="http://patreon.com/dbvolution" target=new>Patreon</a></p> * * @author gregorygraham */ public class AutoFillDuringQueryIfPossibleTest extends AbstractTest { public AutoFillDuringQueryIfPossibleTest(Object testIterationName, Object db) { super(testIterationName, db); } @Test public void testFillingSimpleField() throws SQLException { DBQuery query = database.getDBQuery(new FilledMarque(), new CarCompany()).setBlankQueryAllowed(true); query.getAllRows(); List<FilledMarque> instances = query.getAllInstancesOf(new FilledMarque()); database.print(instances); for (FilledMarque instance : instances) { System.out.println("" + instance.actualCarCo); final CarCompany relatedCarCo = instance.getRelatedInstancesFromQuery(query, new CarCompany()).get(0); final CarCompany actualCarCo = instance.actualCarCo; if (actualCarCo == null) { Assert.assertThat(relatedCarCo, nullValue()); } else { Assert.assertThat(relatedCarCo.name.stringValue(), is(actualCarCo.name.stringValue())); } } } @Test public void testFillingArray() throws SQLException { DBQuery query = database.getDBQuery(new FilledCarCoWithArray(), new Marque()).setBlankQueryAllowed(true); query.getAllRows(); List<FilledCarCoWithArray> instances = query.getAllInstancesOf(new FilledCarCoWithArray()); database.print(instances); for (FilledCarCoWithArray instance : instances) { if (instance.marques != null) { for (Marque marq : instance.marques) { System.out.println("" + marq); } final List<Marque> relateds = instance.getRelatedInstancesFromQuery(query, new Marque()); final Marque[] actuals = instance.marques; Assert.assertThat(relateds, contains(actuals)); } else { System.out.println("No Marques Found For " + instance.name); } } } @Test public void testFillingList() throws SQLException { final FilledCarCoWithList testExample = new FilledCarCoWithList(); DBQuery query = database.getDBQuery(testExample, new Marque()).setBlankQueryAllowed(true); query.getAllRows(); List<FilledCarCoWithList> instances = query.getAllInstancesOf(testExample); database.print(instances); for (FilledCarCoWithList instance : instances) { if (instance.marques != null) { for (Marque marq : instance.marques) { System.out.println("" + marq); } final List<Marque> relateds = instance.getRelatedInstancesFromQuery(query, new Marque()); List<String> relatedNames = new ArrayList<String>(); List<String> actualNames = new ArrayList<String>(); for (Marque related : relateds) { relatedNames.add(related.name.stringValue()); } final List<Marque> actuals = instance.marques; for (Marque actual : actuals) { actualNames.add(actual.name.stringValue()); } Assert.assertThat(relatedNames, contains(actualNames.toArray(new String[]{}))); } else { System.out.println("No Marques Found For " + instance.name); } } } public static class FilledMarque extends Marque { private static final long serialVersionUID = 1L; @AutoFillDuringQueryIfPossible public CarCompany actualCarCo; } public static class FilledCarCoWithArray extends CarCompany { private static final long serialVersionUID = 1L; @AutoFillDuringQueryIfPossible public Marque[] marques; } public static class FilledCarCoWithList extends CarCompany { private static final long serialVersionUID = 1L; @AutoFillDuringQueryIfPossible(requiredClass = Marque.class) public List<Marque> marques; } }
9244fd951b2ca8a9e83eb51c133d2ab0cdb24e59
4,166
java
Java
src/AADLCompiler/runtime/ssac/aadl/runtime/io/TextFileReader.java
degulab/FALCON-SEED
69c7ecd5c13dd75aa33371be086a3e77a068d8ca
[ "MIT" ]
null
null
null
src/AADLCompiler/runtime/ssac/aadl/runtime/io/TextFileReader.java
degulab/FALCON-SEED
69c7ecd5c13dd75aa33371be086a3e77a068d8ca
[ "MIT" ]
null
null
null
src/AADLCompiler/runtime/ssac/aadl/runtime/io/TextFileReader.java
degulab/FALCON-SEED
69c7ecd5c13dd75aa33371be086a3e77a068d8ca
[ "MIT" ]
null
null
null
33.596774
112
0.632021
1,003,206
/* * 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2007-2010 SSAC(Systems of Social Accounting Consortium) * <author> Yasunari Ishizuka (PieCake,Inc.) * <author> Hiroshi Deguchi (TOKYO INSTITUTE OF TECHNOLOGY) * <author> Yuji Onuki (Statistics Bureau) * <author> Shungo Sakaki (Tokyo University of Technology) * <author> Akira Sasaki (HOSEI UNIVERSITY) * <author> Hideki Tanuma (TOKYO INSTITUTE OF TECHNOLOGY) */ /* * @(#)TextFileReader.java 1.50 2010/09/29 * - created by Y.Ishizuka(PieCake.inc,) */ package ssac.aadl.runtime.io; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.UnsupportedEncodingException; import ssac.aadl.runtime.io.internal.AbTextFileReader; /** * テキストファイルを 1 行ずつ読み込むリーダークラス。 * <p>このクラスは、自身がイテレータであり、その反復子を利用して * テキストファイルから 1 行ずつ文字列として取得します。<br> * このクラスの {@link #next()} メソッドが返す文字列には、 * 行終端文字は含まれません。 * <p> * このクラスのインスタンスが生成されると、指定されたファイルをオープンし、 * 読み込み待機状態となります。反復子がファイルの最後まで到達するか、 * 読み込みエラーが発生した場合、このファイルは自動的に閉じられます。 * ファイルが最後まで読み込まれない状態で処理を中断した場合は、 * {@link #close()} メソッドを呼び出してファイルを閉じてください。 * * @version 1.50 2010/09/29 * * @author Yasunari Ishizuka (PieCake,Inc.) * @author Hiroshi Deguchi (TOKYO INSTITUTE OF TECHNOLOGY) * @author Yuji Onuki (Statistics Bureau) * @author Shungo Sakaki (Tokyo University of Technology) * @author Akira Sasaki (HOSEI UNIVERSITY) * @author Hideki Tanuma (TOKYO INSTITUTE OF TECHNOLOGY) * * @since 1.50 */ public class TextFileReader extends AbTextFileReader<String> { //------------------------------------------------------------ // Constants //------------------------------------------------------------ //------------------------------------------------------------ // Fields //------------------------------------------------------------ //------------------------------------------------------------ // Constructions //------------------------------------------------------------ /** * プラットフォーム標準のエンコーディングで指定されたファイルを読み込む、 * <code>TextFileReader</code> の新しいインスタンスを生成します。 * @param file 読み込むファイル * @throws NullPointerException 引数が <tt>null</tt> の場合 * @throws FileNotFoundException ファイルが存在しないか、何らかの理由で開くことができない場合 * @throws SecurityException セキュリティマネージャが存在し、 * <code>checkRead</code> メソッドがファイルへの読み込みアクセスを拒否する場合 */ public TextFileReader(File file) throws FileNotFoundException { super(file); } /** * 指定されたエンコーディングで指定されたファイルを読み込む、 * <code>TextFileReader</code> の新しいインスタンスを生成します。 * @param file 読み込むファイル * @param charsetName エンコーディングとする文字セット名 * @throws NullPointerException 引数が <tt>null</tt> の場合 * @throws FileNotFoundException ファイルが存在しないか、何らかの理由で開くことができない場合 * @throws UnsupportedEncodingException 指定された文字セットがサポートされていない場合 * @throws SecurityException セキュリティマネージャが存在し、 * <code>checkRead</code> メソッドがファイルへの読み込みアクセスを拒否する場合 */ public TextFileReader(File file, String charsetName) throws FileNotFoundException, UnsupportedEncodingException { super(file, charsetName); } //------------------------------------------------------------ // Public interfaces //------------------------------------------------------------ /** * 新しいレコードを読み込み、読み込み済みレコードを更新します。 * このメソッドは、読み込み済みレコードの有無に関わらず、 * 新しいレコードを読み込みます。 * @return 新しいレコードが読み込まれた場合は <tt>true</tt>、そうでない場合は <tt>false</tt> * @throws IOException 読み込みエラーが発生した場合 */ @Override protected boolean readNextRecord() throws IOException { _nextRecord = _reader.readLine(); return (_nextRecord != null); } //------------------------------------------------------------ // Internal methods //------------------------------------------------------------ }
9244fde30a1f4714e568d45a04309978f64ae6e2
862
java
Java
third-integration/zentao/src/main/java/nl/sri/zentao/entity/ZtEntry.java
songdi676/paas-admin
cccf3c8b6a367d3d3bb96ffd9aa034dfb9abf3f7
[ "Apache-2.0" ]
null
null
null
third-integration/zentao/src/main/java/nl/sri/zentao/entity/ZtEntry.java
songdi676/paas-admin
cccf3c8b6a367d3d3bb96ffd9aa034dfb9abf3f7
[ "Apache-2.0" ]
null
null
null
third-integration/zentao/src/main/java/nl/sri/zentao/entity/ZtEntry.java
songdi676/paas-admin
cccf3c8b6a367d3d3bb96ffd9aa034dfb9abf3f7
[ "Apache-2.0" ]
null
null
null
16.901961
54
0.712297
1,003,207
package nl.sri.zentao.entity; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; /** * <p> * * </p> * * @author wurunxiang * @since 2020-07-22 */ @Data @EqualsAndHashCode(callSuper = false) public class ZtEntry implements Serializable { private static final long serialVersionUID = 1L; private Integer id; private String name; private String code; private String key; private String ip; private String desc; @TableField("createdBy") private String createdBy; @TableField("createdDate") private LocalDateTime createdDate; @TableField("editedBy") private String editedBy; @TableField("editedDate") private LocalDateTime editedDate; private String deleted; }
9244ff5ef3822ff508e8be50099a9da089cd93e2
2,647
java
Java
src/main/java/org/gbif/ipt/struts2/IptI18nInterceptor.java
vjrj/ipt
65ebec2f7345cc0b3ab3544a50599c1c0b8e7078
[ "Apache-2.0" ]
106
2015-05-16T05:46:30.000Z
2022-03-15T00:47:27.000Z
src/main/java/org/gbif/ipt/struts2/IptI18nInterceptor.java
vjrj/ipt
65ebec2f7345cc0b3ab3544a50599c1c0b8e7078
[ "Apache-2.0" ]
587
2015-05-15T09:18:48.000Z
2022-03-28T14:18:04.000Z
src/main/java/org/gbif/ipt/struts2/IptI18nInterceptor.java
vjrj/ipt
65ebec2f7345cc0b3ab3544a50599c1c0b8e7078
[ "Apache-2.0" ]
62
2015-05-27T17:02:56.000Z
2022-03-15T19:36:29.000Z
36.260274
109
0.722327
1,003,208
/* * Copyright 2021 Global Biodiversity Information Facility (GBIF) * * 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gbif.ipt.struts2; import java.util.HashSet; import java.util.Locale; import java.util.Set; import org.apache.commons.lang3.LocaleUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.interceptor.I18nInterceptor; /** * An interceptor that ensures that all Locales supported by the IPT can be handled properly. Needed because * Struts2 i18n interceptor only handles Locales supported by the JRE, which is Locale.getAvailableLocales(). */ public class IptI18nInterceptor extends I18nInterceptor { private static final Logger LOG = LogManager.getLogger(IptI18nInterceptor.class); private static final Set<Locale> IPT_SUPPORTED_LOCALES; static { IPT_SUPPORTED_LOCALES = new HashSet<>(); IPT_SUPPORTED_LOCALES.add(Locale.UK); // Used to ensure a day-month-year order in formatted dates. IPT_SUPPORTED_LOCALES.add(Locale.FRENCH); IPT_SUPPORTED_LOCALES.add(Locale.CHINESE); IPT_SUPPORTED_LOCALES.add(Locale.JAPANESE); IPT_SUPPORTED_LOCALES.add(new Locale("es")); IPT_SUPPORTED_LOCALES.add(new Locale("pt")); IPT_SUPPORTED_LOCALES.add(new Locale("ru")); IPT_SUPPORTED_LOCALES.add(new Locale("fa")); } @Override protected Locale getLocaleFromParam(Object requestedLocale) { Locale locale = null; try { if (requestedLocale != null) { locale = (requestedLocale instanceof Locale) ? (Locale) requestedLocale : LocaleUtils.toLocale(requestedLocale.toString()); if (locale != null && LOG.isDebugEnabled()) { LOG.debug("Applied request locale: " + locale.getLanguage()); } } } catch (IllegalArgumentException e) { LOG.debug("Invalid request locale: {}", requestedLocale); locale = Locale.getDefault(); } if (Locale.ENGLISH.equals(locale)) { locale = Locale.UK; } if (locale != null && !IPT_SUPPORTED_LOCALES.contains(locale)) { locale = Locale.getDefault(); } return locale; } }
92450170a18ca362775cab9628a5c7014bd87548
2,879
java
Java
presto-main/src/test/java/com/facebook/presto/TestHiddenColumns.java
andytinycat/presto
48b632cb8c411461198869bd210a5649a27cefe8
[ "Apache-2.0" ]
456
2015-04-23T09:24:25.000Z
2022-01-11T08:49:25.000Z
presto-main/src/test/java/com/facebook/presto/TestHiddenColumns.java
andytinycat/presto
48b632cb8c411461198869bd210a5649a27cefe8
[ "Apache-2.0" ]
10
2015-08-02T15:37:23.000Z
2020-11-18T07:33:46.000Z
presto-main/src/test/java/com/facebook/presto/TestHiddenColumns.java
ricdong/presto
29b76b405b26656d326da8381bbd3f313451df3f
[ "Apache-2.0" ]
123
2015-04-30T04:04:40.000Z
2021-04-08T09:57:34.000Z
41.724638
177
0.708579
1,003,209
/* * 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.facebook.presto; import com.facebook.presto.testing.LocalQueryRunner; import com.facebook.presto.testing.MaterializedResult; import com.facebook.presto.tpch.TpchConnectorFactory; import com.google.common.collect.ImmutableMap; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; import static com.facebook.presto.SessionTestUtils.TEST_SESSION; import static com.facebook.presto.spi.type.BooleanType.BOOLEAN; import static com.facebook.presto.spi.type.VarcharType.VARCHAR; import static org.testng.Assert.assertEquals; public class TestHiddenColumns { private LocalQueryRunner runner; public TestHiddenColumns() { runner = new LocalQueryRunner(TEST_SESSION); runner.createCatalog(TEST_SESSION.getCatalog(), new TpchConnectorFactory(runner.getNodeManager(), 1), ImmutableMap.<String, String>of()); } @AfterClass public void destroy() { if (runner != null) { runner.close(); } } @Test public void testDescribeTable() throws Exception { MaterializedResult expected = MaterializedResult.resultBuilder(TEST_SESSION, VARCHAR, VARCHAR, BOOLEAN, BOOLEAN, VARCHAR) .row("regionkey", "bigint", true, false, "") .row("name", "varchar", true, false, "") .row("comment", "varchar", true, false, "") .build(); assertEquals(runner.execute("DESC REGION"), expected); } @Test public void testSimpleSelect() throws Exception { assertEquals(runner.execute("SELECT * from REGION"), runner.execute("SELECT regionkey, name, comment from REGION")); assertEquals(runner.execute("SELECT *, row_number from REGION"), runner.execute("SELECT regionkey, name, comment, row_number from REGION")); assertEquals(runner.execute("SELECT row_number, * from REGION"), runner.execute("SELECT row_number, regionkey, name, comment from REGION")); assertEquals(runner.execute("SELECT *, row_number, * from REGION"), runner.execute("SELECT regionkey, name, comment, row_number, regionkey, name, comment from REGION")); assertEquals(runner.execute("SELECT row_number, x.row_number from REGION x"), runner.execute("SELECT row_number, row_number from REGION")); } }
924501905b78877fc24117b079cc60b23473877b
15,032
java
Java
library/src/com/nostra13/universalimageloader/core/LoadAndDisplayImageTask.java
worldofwonders/Android-Universal-Image-Loader
021844a472f88bbde44a81182d153ac2ba41cec0
[ "Apache-2.0" ]
2
2020-12-25T20:43:15.000Z
2020-12-26T09:30:19.000Z
library/src/com/nostra13/universalimageloader/core/LoadAndDisplayImageTask.java
corymail/Android-Universal-Image-Loader
d4184857c88ef8db7d36393084853ee6af661065
[ "Apache-2.0" ]
null
null
null
library/src/com/nostra13/universalimageloader/core/LoadAndDisplayImageTask.java
corymail/Android-Universal-Image-Loader
d4184857c88ef8db7d36393084853ee6af661065
[ "Apache-2.0" ]
null
null
null
35.536643
154
0.73736
1,003,210
/******************************************************************************* * Copyright 2011-2013 Sergey Tarasevich * * 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ package com.nostra13.universalimageloader.core; import android.graphics.Bitmap; import android.os.Handler; import android.widget.ImageView; import com.nostra13.universalimageloader.cache.disc.DiscCacheAware; import com.nostra13.universalimageloader.core.assist.*; import com.nostra13.universalimageloader.core.assist.FailReason.FailType; import com.nostra13.universalimageloader.core.decode.ImageDecoder; import com.nostra13.universalimageloader.core.decode.ImageDecodingInfo; import com.nostra13.universalimageloader.core.download.ImageDownloader; import com.nostra13.universalimageloader.core.download.ImageDownloader.Scheme; import com.nostra13.universalimageloader.utils.IoUtils; import com.nostra13.universalimageloader.utils.L; import java.io.*; import java.lang.ref.Reference; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.ReentrantLock; /** * Presents load'n'display image task. Used to load image from Internet or file system, decode it to {@link Bitmap}, and * display it in {@link ImageView} using {@link DisplayBitmapTask}. * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @see ImageLoaderConfiguration * @see ImageLoadingInfo * @since 1.3.1 */ final class LoadAndDisplayImageTask implements Runnable { private static final String LOG_WAITING_FOR_RESUME = "ImageLoader is paused. Waiting... [%s]"; private static final String LOG_RESUME_AFTER_PAUSE = ".. Resume loading [%s]"; private static final String LOG_DELAY_BEFORE_LOADING = "Delay %d ms before loading... [%s]"; private static final String LOG_START_DISPLAY_IMAGE_TASK = "Start display image task [%s]"; private static final String LOG_WAITING_FOR_IMAGE_LOADED = "Image already is loading. Waiting... [%s]"; private static final String LOG_GET_IMAGE_FROM_MEMORY_CACHE_AFTER_WAITING = "...Get cached bitmap from memory after waiting. [%s]"; private static final String LOG_LOAD_IMAGE_FROM_NETWORK = "Load image from network [%s]"; private static final String LOG_LOAD_IMAGE_FROM_DISC_CACHE = "Load image from disc cache [%s]"; private static final String LOG_PREPROCESS_IMAGE = "PreProcess image before caching in memory [%s]"; private static final String LOG_POSTPROCESS_IMAGE = "PostProcess image before displaying [%s]"; private static final String LOG_CACHE_IMAGE_IN_MEMORY = "Cache image in memory [%s]"; private static final String LOG_CACHE_IMAGE_ON_DISC = "Cache image on disc [%s]"; private static final String LOG_PROCESS_IMAGE_BEFORE_CACHE_ON_DISC = "Process image before cache on disc [%s]"; private static final String LOG_TASK_CANCELLED_IMAGEVIEW_REUSED = "ImageView is reused for another image. Task is cancelled. [%s]"; private static final String LOG_TASK_CANCELLED_IMAGEVIEW_LOST = "ImageView was collected by GC. Task is cancelled. [%s]"; private static final String LOG_TASK_INTERRUPTED = "Task was interrupted [%s]"; private static final String ERROR_PRE_PROCESSOR_NULL = "Pre-processor returned null [%s]"; private static final String ERROR_POST_PROCESSOR_NULL = "Pre-processor returned null [%s]"; private static final String ERROR_PROCESSOR_FOR_DISC_CACHE_NULL = "Bitmap processor for disc cache returned null [%s]"; private static final int BUFFER_SIZE = 32 * 1024; // 32 Kb private final ImageLoaderEngine engine; private final ImageLoadingInfo imageLoadingInfo; private final Handler handler; // Helper references private final ImageLoaderConfiguration configuration; private final ImageDownloader downloader; private final ImageDownloader networkDeniedDownloader; private final ImageDownloader slowNetworkDownloader; private final ImageDecoder decoder; private final boolean writeLogs; final String uri; private final String memoryCacheKey; final Reference<ImageView> imageViewRef; private final ImageSize targetSize; final DisplayImageOptions options; final ImageLoadingListener listener; // State vars private LoadedFrom loadedFrom = LoadedFrom.NETWORK; private boolean imageViewCollected = false; public LoadAndDisplayImageTask(ImageLoaderEngine engine, ImageLoadingInfo imageLoadingInfo, Handler handler) { this.engine = engine; this.imageLoadingInfo = imageLoadingInfo; this.handler = handler; configuration = engine.configuration; downloader = configuration.downloader; networkDeniedDownloader = configuration.networkDeniedDownloader; slowNetworkDownloader = configuration.slowNetworkDownloader; decoder = configuration.decoder; writeLogs = configuration.writeLogs; uri = imageLoadingInfo.uri; memoryCacheKey = imageLoadingInfo.memoryCacheKey; imageViewRef = imageLoadingInfo.imageViewRef; targetSize = imageLoadingInfo.targetSize; options = imageLoadingInfo.options; listener = imageLoadingInfo.listener; } @Override public void run() { if (waitIfPaused()) return; if (delayIfNeed()) return; ReentrantLock loadFromUriLock = imageLoadingInfo.loadFromUriLock; log(LOG_START_DISPLAY_IMAGE_TASK); if (loadFromUriLock.isLocked()) { log(LOG_WAITING_FOR_IMAGE_LOADED); } loadFromUriLock.lock(); Bitmap bmp; try { if (checkTaskIsNotActual()) return; bmp = configuration.memoryCache.get(memoryCacheKey); if (bmp == null) { bmp = tryLoadBitmap(); if (imageViewCollected) return; // listener callback already was fired if (bmp == null) return; // listener callback already was fired if (checkTaskIsNotActual() || checkTaskIsInterrupted()) return; if (options.shouldPreProcess()) { log(LOG_PREPROCESS_IMAGE); bmp = options.getPreProcessor().process(bmp); if (bmp == null) { L.e(ERROR_PRE_PROCESSOR_NULL); } } if (bmp != null && options.isCacheInMemory()) { log(LOG_CACHE_IMAGE_IN_MEMORY); configuration.memoryCache.put(memoryCacheKey, bmp); } } else { loadedFrom = LoadedFrom.MEMORY_CACHE; log(LOG_GET_IMAGE_FROM_MEMORY_CACHE_AFTER_WAITING); } if (bmp != null && options.shouldPostProcess()) { log(LOG_POSTPROCESS_IMAGE); bmp = options.getPostProcessor().process(bmp); if (bmp == null) { L.e(ERROR_POST_PROCESSOR_NULL, memoryCacheKey); } } } finally { loadFromUriLock.unlock(); } if (checkTaskIsNotActual() || checkTaskIsInterrupted()) return; DisplayBitmapTask displayBitmapTask = new DisplayBitmapTask(bmp, imageLoadingInfo, engine, loadedFrom); displayBitmapTask.setLoggingEnabled(writeLogs); handler.post(displayBitmapTask); } /** @return true - if task should be interrupted; false - otherwise */ private boolean waitIfPaused() { AtomicBoolean pause = engine.getPause(); synchronized (pause) { if (pause.get()) { log(LOG_WAITING_FOR_RESUME); try { pause.wait(); } catch (InterruptedException e) { L.e(LOG_TASK_INTERRUPTED, memoryCacheKey); return true; } log(LOG_RESUME_AFTER_PAUSE); } } return checkTaskIsNotActual(); } /** @return true - if task should be interrupted; false - otherwise */ private boolean delayIfNeed() { if (options.shouldDelayBeforeLoading()) { log(LOG_DELAY_BEFORE_LOADING, options.getDelayBeforeLoading(), memoryCacheKey); try { Thread.sleep(options.getDelayBeforeLoading()); } catch (InterruptedException e) { L.e(LOG_TASK_INTERRUPTED, memoryCacheKey); return true; } return checkTaskIsNotActual(); } return false; } /** * Check whether target ImageView wasn't collected by GC and the image URI of this task matches to image URI which is actual * for current ImageView at this moment and fire {@link ImageLoadingListener#onLoadingCancelled(String, android.view.View)}} * event if it doesn't. */ private boolean checkTaskIsNotActual() { ImageView imageView = checkImageViewRef(); return imageView == null || checkImageViewReused(imageView); } private ImageView checkImageViewRef() { ImageView imageView = imageViewRef.get(); if (imageView == null) { imageViewCollected = true; log(LOG_TASK_CANCELLED_IMAGEVIEW_LOST); fireCancelEvent(); } return imageView; } private boolean checkImageViewReused(ImageView imageView) { String currentCacheKey = engine.getLoadingUriForView(imageView); // Check whether memory cache key (image URI) for current ImageView is actual. // If ImageView is reused for another task then current task should be cancelled. boolean imageViewWasReused = !memoryCacheKey.equals(currentCacheKey); if (imageViewWasReused) { log(LOG_TASK_CANCELLED_IMAGEVIEW_REUSED); fireCancelEvent(); } return imageViewWasReused; } /** Check whether the current task was interrupted */ private boolean checkTaskIsInterrupted() { boolean interrupted = Thread.interrupted(); if (interrupted) log(LOG_TASK_INTERRUPTED); return interrupted; } private Bitmap tryLoadBitmap() { File imageFile = getImageFileInDiscCache(); Bitmap bitmap = null; try { if (imageFile.exists()) { log(LOG_LOAD_IMAGE_FROM_DISC_CACHE); loadedFrom = LoadedFrom.DISC_CACHE; bitmap = decodeImage(Scheme.FILE.wrap(imageFile.getAbsolutePath())); if (imageViewCollected) return null; } if (bitmap == null || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) { log(LOG_LOAD_IMAGE_FROM_NETWORK); loadedFrom = LoadedFrom.NETWORK; String imageUriForDecoding = options.isCacheOnDisc() ? tryCacheImageOnDisc(imageFile) : uri; if (!checkTaskIsNotActual()) { bitmap = decodeImage(imageUriForDecoding); if (imageViewCollected) return null; if (bitmap == null || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) { fireFailEvent(FailType.DECODING_ERROR, null); } } } } catch (IllegalStateException e) { fireFailEvent(FailType.NETWORK_DENIED, null); } catch (IOException e) { L.e(e); fireFailEvent(FailType.IO_ERROR, e); if (imageFile.exists()) { imageFile.delete(); } } catch (OutOfMemoryError e) { L.e(e); fireFailEvent(FailType.OUT_OF_MEMORY, e); } catch (Throwable e) { L.e(e); fireFailEvent(FailType.UNKNOWN, e); } return bitmap; } private File getImageFileInDiscCache() { DiscCacheAware discCache = configuration.discCache; File imageFile = discCache.get(uri); File cacheDir = imageFile.getParentFile(); if (cacheDir == null || (!cacheDir.exists() && !cacheDir.mkdirs())) { imageFile = configuration.reserveDiscCache.get(uri); cacheDir = imageFile.getParentFile(); if (cacheDir != null && !cacheDir.exists()) { cacheDir.mkdirs(); } } return imageFile; } private Bitmap decodeImage(String imageUri) throws IOException { ImageView imageView = checkImageViewRef(); if (imageView == null) return null; ViewScaleType viewScaleType = ViewScaleType.fromImageView(imageView); ImageDecodingInfo decodingInfo = new ImageDecodingInfo(memoryCacheKey, imageUri, targetSize, viewScaleType, getDownloader(), options); return decoder.decode(decodingInfo); } /** @return Cached image URI; or original image URI if caching failed */ private String tryCacheImageOnDisc(File targetFile) { log(LOG_CACHE_IMAGE_ON_DISC); try { int width = configuration.maxImageWidthForDiscCache; int height = configuration.maxImageHeightForDiscCache; boolean saved = false; if (width > 0 || height > 0) { saved = downloadSizedImage(targetFile, width, height); } if (!saved) { downloadImage(targetFile); } configuration.discCache.put(uri, targetFile); return Scheme.FILE.wrap(targetFile.getAbsolutePath()); } catch (IOException e) { L.e(e); return uri; } } private boolean downloadSizedImage(File targetFile, int maxWidth, int maxHeight) throws IOException { // Download, decode, compress and save image ImageSize targetImageSize = new ImageSize(maxWidth, maxHeight); DisplayImageOptions specialOptions = new DisplayImageOptions.Builder().cloneFrom(options).imageScaleType(ImageScaleType.IN_SAMPLE_INT).build(); ImageDecodingInfo decodingInfo = new ImageDecodingInfo(memoryCacheKey, uri, targetImageSize, ViewScaleType.FIT_INSIDE, getDownloader(), specialOptions); Bitmap bmp = decoder.decode(decodingInfo); if (bmp == null) return false; if (configuration.processorForDiscCache != null) { log(LOG_PROCESS_IMAGE_BEFORE_CACHE_ON_DISC); bmp = configuration.processorForDiscCache.process(bmp); if (bmp == null) { L.e(ERROR_PROCESSOR_FOR_DISC_CACHE_NULL, memoryCacheKey); return false; } } OutputStream os = new BufferedOutputStream(new FileOutputStream(targetFile), BUFFER_SIZE); boolean savedSuccessfully; try { savedSuccessfully = bmp.compress(configuration.imageCompressFormatForDiscCache, configuration.imageQualityForDiscCache, os); } finally { IoUtils.closeSilently(os); } bmp.recycle(); return savedSuccessfully; } private void downloadImage(File targetFile) throws IOException { InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader()); try { OutputStream os = new BufferedOutputStream(new FileOutputStream(targetFile), BUFFER_SIZE); try { IoUtils.copyStream(is, os); } finally { IoUtils.closeSilently(os); } } finally { IoUtils.closeSilently(is); } } private void fireFailEvent(final FailType failType, final Throwable failCause) { if (!Thread.interrupted()) { handler.post(new Runnable() { @Override public void run() { ImageView imageView = imageViewRef.get(); if (imageView != null && options.shouldShowImageOnFail()) { imageView.setImageResource(options.getImageOnFail()); } listener.onLoadingFailed(uri, imageView, new FailReason(failType, failCause)); } }); } } private void fireCancelEvent() { if (!Thread.interrupted()) { handler.post(new Runnable() { @Override public void run() { listener.onLoadingCancelled(uri, imageViewRef.get()); } }); } } private ImageDownloader getDownloader() { ImageDownloader d; if (engine.isNetworkDenied()) { d = networkDeniedDownloader; } else if (engine.isSlowNetwork()) { d = slowNetworkDownloader; } else { d = downloader; } return d; } String getLoadingUri() { return uri; } private void log(String message) { if (writeLogs) L.d(message, memoryCacheKey); } private void log(String message, Object... args) { if (writeLogs) L.d(message, args); } }
924502c56670017dadcb56fcebb733476e510c6e
1,311
java
Java
src/main/java/com/amadeus/jenkins/opentracing/WorkaroundGraphListener.java
AmadeusITGroup/jenkins-opentracing-plugin
56cc6cd903770d35db27d3cacd86ded1e4b6f43a
[ "MIT" ]
null
null
null
src/main/java/com/amadeus/jenkins/opentracing/WorkaroundGraphListener.java
AmadeusITGroup/jenkins-opentracing-plugin
56cc6cd903770d35db27d3cacd86ded1e4b6f43a
[ "MIT" ]
null
null
null
src/main/java/com/amadeus/jenkins/opentracing/WorkaroundGraphListener.java
AmadeusITGroup/jenkins-opentracing-plugin
56cc6cd903770d35db27d3cacd86ded1e4b6f43a
[ "MIT" ]
1
2021-04-09T11:01:51.000Z
2021-04-09T11:01:51.000Z
38.558824
97
0.786423
1,003,211
package com.amadeus.jenkins.opentracing; import hudson.Extension; import hudson.ExtensionList; import org.jenkinsci.plugins.workflow.flow.GraphListener; import org.jenkinsci.plugins.workflow.graph.FlowNode; import org.jenkinsci.plugins.workflow.graph.FlowStartNode; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.DoNotUse; /** * This class works around https://issues.jenkins-ci.org/browse/JENKINS-52189 Especially the part * where {@link GraphListener}s attached during {@link * org.jenkinsci.plugins.workflow.flow.FlowExecutionListener#onRunning} do not receive the * FlowStartNode. As the per instance logic is nicer to reason about and may work properly in a * future version of Jenkins, this class will be the bridge until then. */ @Extension @Restricted(DoNotUse.class) public final class WorkaroundGraphListener implements GraphListener, GraphListener.Synchronous { private final OTFlowExecutionListener flowExecutionListener = ExtensionList.lookupSingleton(OTFlowExecutionListener.class); @Override public void onNewHead(FlowNode node) { if (node instanceof FlowStartNode) { OTGraphListener listener = flowExecutionListener.getListener(node.getExecution()); if (listener != null) { listener.onNewHead(node); } } } }
924504790343cb13c19b9b99d3d1f880eaa16a98
9,590
java
Java
src/test/java/net/iaminnovative/keyvault/AzureCryptoClientTest.java
magooster/kv-tm
bd6ea75e5ff095b2d85e69a24f245bbba95418ae
[ "Apache-2.0" ]
null
null
null
src/test/java/net/iaminnovative/keyvault/AzureCryptoClientTest.java
magooster/kv-tm
bd6ea75e5ff095b2d85e69a24f245bbba95418ae
[ "Apache-2.0" ]
null
null
null
src/test/java/net/iaminnovative/keyvault/AzureCryptoClientTest.java
magooster/kv-tm
bd6ea75e5ff095b2d85e69a24f245bbba95418ae
[ "Apache-2.0" ]
null
null
null
39.146341
118
0.588266
1,003,212
/* * Copyright 2020 Ian Cusden. * * 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 applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ package net.iaminnovative.keyvault; import java.math.BigInteger; import java.security.*; import java.security.spec.InvalidKeySpecException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import com.azure.core.credential.TokenCredential; import com.azure.core.util.polling.SyncPoller; import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.keyvault.keys.KeyClient; import com.azure.security.keyvault.keys.KeyClientBuilder; import com.azure.security.keyvault.keys.models.DeletedKey; import com.azure.security.keyvault.keys.models.JsonWebKey; import com.azure.security.keyvault.keys.models.KeyVaultKey; import org.apache.tuweni.bytes.Bytes32; import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey; import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey; import org.bouncycastle.jce.ECNamedCurveTable; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.jce.spec.ECParameterSpec; import org.bouncycastle.jce.spec.ECPrivateKeySpec; import org.bouncycastle.jce.spec.ECPublicKeySpec; import org.bouncycastle.math.ec.ECPoint; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import net.iaminnovative.KeyVaultException; import static net.iaminnovative.keyvault.AzureCryptoClient.*; import static org.junit.jupiter.api.Assertions.*; @ExtendWith(KeyVaultConfigured.class) public class AzureCryptoClientTest { private static final Map<String, String> keys; static { keys = new HashMap<>(); keys.put( "fcc168dba3e7f15a1f8cceb927854567e05357a9", "vqbpgud2ghvjgm1n5hdgjnn5818fzsf2"); keys.put( "kgfhvu9qnh3mr6eel97y6fq2hezzol8z", "860d857178c57044f1f8cd23e6bd2b5ca192f2bb0e27562565d34d33563115e7"); } private static final Map<String, String> keyVaultKeys = new HashMap<>(); private static final Map<String, BigInteger> publicKeys = new HashMap<>(); private static final String KEY_VAULT_URI = "https://" + System.getenv("AZURE_KEY_VAULT_NAME") + ".vault.azure.net/"; @BeforeAll static void setupVault() { Security.addProvider(new BouncyCastleProvider()); KeyClient keyClient = new KeyClientBuilder() .vaultUrl(KEY_VAULT_URI) .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); keys.forEach( (address, privateKeyHex) -> { Bytes32 privateKeyBytes = Bytes32.fromHexString(privateKeyHex); BigInteger s = privateKeyBytes.toUnsignedBigInteger(); KeyFactory keyFactory = null; try { keyFactory = KeyFactory.getInstance("ECDSA", "BC"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (NoSuchProviderException e) { e.printStackTrace(); } ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("secp256k1"); ECPrivateKeySpec privateKeySpec = new ECPrivateKeySpec(s, ecSpec); BCECPrivateKey privateKey = null; try { privateKey = (BCECPrivateKey) keyFactory.generatePrivate(privateKeySpec); } catch (InvalidKeySpecException e) { e.printStackTrace(); } ECPoint Q = ecSpec.getG().multiply((privateKey).getD()); ECPublicKeySpec pubSpec = new ECPublicKeySpec(Q, ecSpec); BCECPublicKey publicKey = null; try { publicKey = (BCECPublicKey) keyFactory.generatePublic(pubSpec); } catch (InvalidKeySpecException e) { e.printStackTrace(); } final byte[] publicKeyBytes = publicKey.getQ().getEncoded(false); KeyPair keyPair = new KeyPair(publicKey, privateKey); final JsonWebKey jsonWebKey = JsonWebKey.fromEc(keyPair, Security.getProvider("BC")); final KeyVaultKey importedKey = keyClient.importKey(address, jsonWebKey); keyVaultKeys.put(importedKey.getId(), address); publicKeys.put( importedKey.getId(), new BigInteger( 1, Arrays.copyOfRange(publicKeyBytes, 1, publicKeyBytes.length))); }); } @AfterAll static void cleanupVault() { KeyClient client = new KeyClientBuilder() .vaultUrl(KEY_VAULT_URI) .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); keys.forEach( (address, privateKeyHex) -> { SyncPoller<DeletedKey, Void> deletedKeyPoller = client.beginDeleteKey(address); deletedKeyPoller.waitForCompletion(); }); for (DeletedKey deletedKey : client.listDeletedKeys()) { client.purgeDeletedKey(deletedKey.getName()); } } @Test public void testGetFromAddress() { keyVaultKeys.forEach( (id, address) -> { AzureCryptoClient client = new AzureCryptoClient(id); assertEquals("0x" + address, client.getAddress()); }); } @Test public void testGetPublicKey() { publicKeys.forEach( (id, publicKey) -> { AzureCryptoClient client = new AzureCryptoClient(id); assertEquals(publicKey, client.getPublicKey()); }); } @Test public void testInvalidKeyException() { String invalidKeyId = KEY_VAULT_URI + "/keys/invalid/224120347bc041d682d0bf0e7f8f9ec6"; Exception exception = assertThrows( KeyVaultException.class, () -> { new AzureCryptoClient(invalidKeyId); }); assertEquals(INVALID_KEY_ERROR, exception.getMessage()); } @Test public void testBadParameterException() { String keyId = keyVaultKeys.keySet().toArray()[0].toString(); String invalidKeyId = keyId.substring(0, keyId.length() - 4); Exception exception = assertThrows( KeyVaultException.class, () -> { new AzureCryptoClient(invalidKeyId); }); assertEquals(INVALID_KEY_ERROR, exception.getMessage()); } @Test public void testInvalidHostException() { String invalidKeyId = "https://unlikelytoexist.vault.azure.net/keys/invalid/224120347bc041d682d0bf0e7f8f9ec6"; Exception exception = assertThrows( KeyVaultException.class, () -> { new AzureCryptoClient(invalidKeyId); }); assertEquals(INVALID_VAULT_ERROR_MSG, exception.getMessage()); } @Test public void testValidCustomCredentials() { TokenCredential credential = new ClientSecretCredentialBuilder() .tenantId(System.getenv("AZURE_TENANT_ID")) .clientId(System.getenv("AZURE_CLIENT_ID")) .clientSecret(System.getenv("AZURE_CLIENT_SECRET")) .build(); keyVaultKeys.forEach( (id, address) -> { AzureCryptoClient client = new AzureCryptoClient(id, credential); assertEquals("0x" + address, client.getAddress()); }); } @Test public void testInvalidCredentialsException() { TokenCredential credential = new ClientSecretCredentialBuilder() .tenantId(System.getenv("AZURE_TENANT_ID")) .clientId(System.getenv("AZURE_CLIENT_ID")) .clientSecret("1234") .build(); Exception exception = assertThrows( KeyVaultException.class, () -> { new AzureCryptoClient( keyVaultKeys.keySet().toArray()[0].toString(), credential); }); assertEquals("Unknown", exception.getMessage()); } }
92450484f6f9d996e3c9bcff38106a1ff7cdc752
487
java
Java
src/com/debanshu777/manager/FilmManagerInterface.java
Debanshu777/ExtJS-Movie-Crud-App
5fdc50f214eef65491090db771d460b95d94108b
[ "Apache-2.0" ]
null
null
null
src/com/debanshu777/manager/FilmManagerInterface.java
Debanshu777/ExtJS-Movie-Crud-App
5fdc50f214eef65491090db771d460b95d94108b
[ "Apache-2.0" ]
null
null
null
src/com/debanshu777/manager/FilmManagerInterface.java
Debanshu777/ExtJS-Movie-Crud-App
5fdc50f214eef65491090db771d460b95d94108b
[ "Apache-2.0" ]
null
null
null
32.466667
83
0.815195
1,003,213
package com.debanshu777.manager; import com.debanshu777.daoImpl.FilmHibernateDAO; import com.debanshu777.model.FilmPOJO; public interface FilmManagerInterface { public FilmHibernateDAO getInstance(); public void insert(FilmPOJO insertfilm); public void update(FilmPOJO updatefilm); public void delete(int id); public String fetch(String data_querry,int page, int total,String count_querry) ; public String getData(String data_querry,int page, int total,String count_querry); }
9245055830598bc3987c5399691e878f1552154c
1,512
java
Java
FxBrowser/src/main/java/OTM_FX/FxBrowser/DialogBoxOLD.java
OpenTravel/otm-dex
6055e9f4649fc776164bb9cd054713b1b4e87bb7
[ "Apache-2.0" ]
null
null
null
FxBrowser/src/main/java/OTM_FX/FxBrowser/DialogBoxOLD.java
OpenTravel/otm-dex
6055e9f4649fc776164bb9cd054713b1b4e87bb7
[ "Apache-2.0" ]
1
2019-12-05T16:30:21.000Z
2019-12-20T17:22:49.000Z
FxBrowser/src/main/java/OTM_FX/FxBrowser/DialogBoxOLD.java
OpenTravel/otm-dex
6055e9f4649fc776164bb9cd054713b1b4e87bb7
[ "Apache-2.0" ]
null
null
null
25.2
66
0.699074
1,003,214
/** * */ package OTM_FX.FxBrowser; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.VBox; import javafx.stage.Modality; import javafx.stage.Stage; /** * @author dmh * */ @SuppressWarnings("restriction") public class DialogBoxOLD { static boolean answer; private static String cancelText = "Cancel"; private static String closeText = "Close"; // TODO - constructor with text passed in public static boolean display(String title, String message) { Stage window = new Stage(); // Block events to other windows window.initModality(Modality.APPLICATION_MODAL); window.setTitle(title); window.setMinWidth(350); Label label = new Label(message); Button cancelButton = new Button(cancelText); cancelButton.setAlignment(Pos.BOTTOM_LEFT); // does not work cancelButton.setOnAction(e -> { answer = false; window.close(); }); Button closeButton = new Button(closeText); closeButton.setAlignment(Pos.BOTTOM_RIGHT); // does not work closeButton.setOnAction(e -> { answer = true; window.close(); }); VBox layout = new VBox(10); layout.getChildren().addAll(label, closeButton, cancelButton); layout.setAlignment(Pos.CENTER); // Display window and wait for it to be closed before returning Scene scene = new Scene(layout); window.setScene(scene); window.showAndWait(); return answer; } }
9245058efe8a932e86f23d38994a29305cb5a186
15,897
java
Java
app/src/main/java/com/lwd/qjtv/view/CustomCursorAdapter.java
541660139/qjtv
a2aed5aca0e7a4211226e1a8a6f5e63c4f401fc5
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/lwd/qjtv/view/CustomCursorAdapter.java
541660139/qjtv
a2aed5aca0e7a4211226e1a8a6f5e63c4f401fc5
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/lwd/qjtv/view/CustomCursorAdapter.java
541660139/qjtv
a2aed5aca0e7a4211226e1a8a6f5e63c4f401fc5
[ "Apache-2.0" ]
null
null
null
40.452926
113
0.641276
1,003,215
package com.lwd.qjtv.view; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.support.annotation.RestrictTo; import android.support.v4.widget.CursorAdapter; import android.support.v4.widget.SimpleCursorAdapter; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.lwd.qjtv.mvp.ui.callback.CursorDeleteCallback; import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP; /** * Email:[email protected] * Created by ZhengQian on 2017/6/16. */ public class CustomCursorAdapter extends SimpleCursorAdapter { /** * A list of columns containing the data to bind to the UI. * This field should be made private, so it is hidden from the SDK. * {@hide} */ @RestrictTo(LIBRARY_GROUP) protected int[] mFrom; /** * A list of View ids representing the views to which the data must be bound. * This field should be made private, so it is hidden from the SDK. * {@hide} */ @RestrictTo(LIBRARY_GROUP) protected int[] mTo; private CursorDeleteCallback cursorDeleteCallback; private int mStringConversionColumn = -1; private SimpleCursorAdapter.CursorToStringConverter mCursorToStringConverter; private SimpleCursorAdapter.ViewBinder mViewBinder; String[] mOriginalFrom; /** * Constructor the enables auto-requery. * * @deprecated This option is discouraged, as it results in Cursor queries * being performed on the application's UI thread and thus can cause poor * responsiveness or even Application Not Responding errors. As an alternative, * use {@link android.app.LoaderManager} with a {@link android.content.CursorLoader}. */ @Deprecated public CustomCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { this(context, layout, c, from, to, 0); mTo = to; mOriginalFrom = from; findColumns(c, from); } /** * Standard constructor. * * @param context The context where the ListView associated with this * SimpleListItemFactory is running * @param layout resource identifier of a layout file that defines the views * for this list item. The layout file should include at least * those named views defined in "to" * @param c The database cursor. Can be null if the cursor is not available yet. * @param from A list of column names representing the data to bind to the UI. Can be null * if the cursor is not available yet. * @param to The views that should display column in the "from" parameter. * These should all be TextViews. The first N views in this list * are given the values of the first N columns in the from * parameter. Can be null if the cursor is not available yet. * @param flags Flags used to determine the behavior of the adapter, * as per {@link CursorAdapter#CursorAdapter(Context, Cursor, int)}. */ public CustomCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) { super(context, layout, c, from, to, flags); mTo = to; mOriginalFrom = from; findColumns(c, from); } /** * Binds all of the field names passed into the "to" parameter of the * constructor with their corresponding cursor columns as specified in the * "from" parameter. * <p> * Binding occurs in two phases. First, if a * {@link android.widget.SimpleCursorAdapter.ViewBinder} is available, * {@link SimpleCursorAdapter.ViewBinder#setViewValue(android.view.View, android.database.Cursor, int)} * is invoked. If the returned value is true, binding has occured. If the * returned value is false and the view to bind is a TextView, * {@link #setViewText(TextView, String)} is invoked. If the returned value is * false and the view to bind is an ImageView, * {@link #setViewImage(ImageView, String)} is invoked. If no appropriate * binding can be found, an {@link IllegalStateException} is thrown. * * @throws IllegalStateException if binding cannot occur * @see android.widget.CursorAdapter#bindView(View, Context, Cursor) * @see #getViewBinder() * @see #setViewBinder(SimpleCursorAdapter.ViewBinder) * @see #setViewImage(ImageView, String) * @see #setViewText(TextView, String) */ @Override public void bindView(View view, Context context, Cursor cursor) { final SimpleCursorAdapter.ViewBinder binder = mViewBinder; final int count = mTo.length; final int[] from = mFrom; final int[] to = mTo; for (int i = 0; i < count; i++) { final View v = view.findViewById(to[i]); if (v != null) { boolean bound = false; if (binder != null) { bound = binder.setViewValue(v, cursor, from[i]); } if (!bound) { String text = cursor.getString(from[i]); if (text == null) { text = ""; } if (v instanceof TextView) { setViewText((TextView) v, text); } else if (v instanceof ImageView) { setViewImage((ImageView) v, text, cursor, i); } else { throw new IllegalStateException(v.getClass().getName() + " is not a " + " view that can be bounds by this SimpleCursorAdapter"); } } } } } /** * Returns the {@link SimpleCursorAdapter.ViewBinder} used to bind data to views. * * @return a ViewBinder or null if the binder does not exist * @see #bindView(android.view.View, android.content.Context, android.database.Cursor) * @see #setViewBinder(SimpleCursorAdapter.ViewBinder) */ public SimpleCursorAdapter.ViewBinder getViewBinder() { return mViewBinder; } /** * Sets the binder used to bind data to views. * * @param viewBinder the binder used to bind data to views, can be null to * remove the existing binder * @see #bindView(android.view.View, android.content.Context, android.database.Cursor) * @see #getViewBinder() */ public void setViewBinder(SimpleCursorAdapter.ViewBinder viewBinder) { mViewBinder = viewBinder; } /** * Called by bindView() to set the image for an ImageView but only if * there is no existing ViewBinder or if the existing ViewBinder cannot * handle binding to an ImageView. * <p> * By default, the value will be treated as an image resource. If the * value cannot be used as an image resource, the value is used as an * image Uri. * <p> * Intended to be overridden by Adapters that need to filter strings * retrieved from the database. * * @param v ImageView to receive an image * @param value the value retrieved from the cursor */ public void setViewImage(ImageView v, String value, Cursor cursor, int position) { try { v.setImageResource(Integer.parseInt(value)); if ("R.id.search_delete_iv".equals(value)) { v.setOnClickListener(view -> cursorDeleteCallback.deleteItem(cursor, position)); } } catch (NumberFormatException nfe) { v.setImageURI(Uri.parse(value)); } } public void setCursorDeleteCallback(CursorDeleteCallback cursorDeleteCallback) { this.cursorDeleteCallback = cursorDeleteCallback; } /** * Called by bindView() to set the text for a TextView but only if * there is no existing ViewBinder or if the existing ViewBinder cannot * handle binding to a TextView. * <p> * Intended to be overridden by Adapters that need to filter strings * retrieved from the database. * * @param v TextView to receive text * @param text the text to be set for the TextView */ public void setViewText(TextView v, String text) { v.setText(text); } /** * Return the index of the column used to get a String representation * of the Cursor. * * @return a valid index in the current Cursor or -1 * @see android.widget.CursorAdapter#convertToString(android.database.Cursor) * @see #setStringConversionColumn(int) * @see #setCursorToStringConverter(SimpleCursorAdapter.CursorToStringConverter) * @see #getCursorToStringConverter() */ public int getStringConversionColumn() { return mStringConversionColumn; } /** * Defines the index of the column in the Cursor used to get a String * representation of that Cursor. The column is used to convert the * Cursor to a String only when the current CursorToStringConverter * is null. * * @param stringConversionColumn a valid index in the current Cursor or -1 to use the default * conversion mechanism * @see android.widget.CursorAdapter#convertToString(android.database.Cursor) * @see #getStringConversionColumn() * @see #setCursorToStringConverter(SimpleCursorAdapter.CursorToStringConverter) * @see #getCursorToStringConverter() */ public void setStringConversionColumn(int stringConversionColumn) { mStringConversionColumn = stringConversionColumn; } /** * Returns the converter used to convert the filtering Cursor * into a String. * * @return null if the converter does not exist or an instance of * {@link android.widget.SimpleCursorAdapter.CursorToStringConverter} * @see #setCursorToStringConverter(SimpleCursorAdapter.CursorToStringConverter) * @see #getStringConversionColumn() * @see #setStringConversionColumn(int) * @see android.widget.CursorAdapter#convertToString(android.database.Cursor) */ public SimpleCursorAdapter.CursorToStringConverter getCursorToStringConverter() { return mCursorToStringConverter; } /** * Sets the converter used to convert the filtering Cursor * into a String. * * @param cursorToStringConverter the Cursor to String converter, or * null to remove the converter * @see #setCursorToStringConverter(SimpleCursorAdapter.CursorToStringConverter) * @see #getStringConversionColumn() * @see #setStringConversionColumn(int) * @see android.widget.CursorAdapter#convertToString(android.database.Cursor) */ public void setCursorToStringConverter(SimpleCursorAdapter.CursorToStringConverter cursorToStringConverter) { mCursorToStringConverter = cursorToStringConverter; } /** * Returns a CharSequence representation of the specified Cursor as defined * by the current CursorToStringConverter. If no CursorToStringConverter * has been set, the String conversion column is used instead. If the * conversion column is -1, the returned String is empty if the cursor * is null or Cursor.toString(). * * @param cursor the Cursor to convert to a CharSequence * @return a non-null CharSequence representing the cursor */ @Override public CharSequence convertToString(Cursor cursor) { if (mCursorToStringConverter != null) { return mCursorToStringConverter.convertToString(cursor); } else if (mStringConversionColumn > -1) { return cursor.getString(mStringConversionColumn); } return super.convertToString(cursor); } /** * Create a map from an array of strings to an array of column-id integers in cursor c. * If c is null, the array will be discarded. * * @param c the cursor to find the columns from * @param from the Strings naming the columns of interest */ private void findColumns(Cursor c, String[] from) { if (c != null) { int i; int count = from.length; if (mFrom == null || mFrom.length != count) { mFrom = new int[count]; } for (i = 0; i < count; i++) { mFrom[i] = c.getColumnIndexOrThrow(from[i]); } } else { mFrom = null; } } @Override public Cursor swapCursor(Cursor c) { // super.swapCursor() will notify observers before we have // a valid mapping, make sure we have a mapping before this // happens findColumns(c, mOriginalFrom); return super.swapCursor(c); } /** * Change the cursor and change the column-to-view mappings at the same time. * * @param c The database cursor. Can be null if the cursor is not available yet. * @param from A list of column names representing the data to bind to the UI. Can be null * if the cursor is not available yet. * @param to The views that should display column in the "from" parameter. * These should all be TextViews. The first N views in this list * are given the values of the first N columns in the from * parameter. Can be null if the cursor is not available yet. */ public void changeCursorAndColumns(Cursor c, String[] from, int[] to) { mOriginalFrom = from; mTo = to; // super.changeCursor() will notify observers before we have // a valid mapping, make sure we have a mapping before this // happens findColumns(c, mOriginalFrom); super.changeCursor(c); } /** * This class can be used by external clients of SimpleCursorAdapter * to bind values fom the Cursor to views. * <p> * You should use this class to bind values from the Cursor to views * that are not directly supported by SimpleCursorAdapter or to * change the way binding occurs for views supported by * SimpleCursorAdapter. * * @see SimpleCursorAdapter#bindView(View, Context, Cursor) * @see SimpleCursorAdapter#setViewImage(ImageView, String) * @see SimpleCursorAdapter#setViewText(TextView, String) */ public interface ViewBinder { /** * Binds the Cursor column defined by the specified index to the specified view. * <p> * When binding is handled by this ViewBinder, this method must return true. * If this method returns false, SimpleCursorAdapter will attempts to handle * the binding on its own. * * @param view the view to bind the data to * @param cursor the cursor to get the data from * @param columnIndex the column at which the data can be found in the cursor * @return true if the data was bound to the view, false otherwise */ boolean setViewValue(View view, Cursor cursor, int columnIndex); } /** * This class can be used by external clients of SimpleCursorAdapter * to define how the Cursor should be converted to a String. * * @see android.widget.CursorAdapter#convertToString(android.database.Cursor) */ public interface CursorToStringConverter { /** * Returns a CharSequence representing the specified Cursor. * * @param cursor the cursor for which a CharSequence representation * is requested * @return a non-null CharSequence representing the cursor */ CharSequence convertToString(Cursor cursor); } }
9245061e84a6e73efaf933221d6ffb5765da98fa
107
java
Java
src/patterns/visitor/Node.java
dictxwang/java-design-patterns
b7836ee832a54bb5653b2c70c6501723b6aa7a70
[ "MIT" ]
null
null
null
src/patterns/visitor/Node.java
dictxwang/java-design-patterns
b7836ee832a54bb5653b2c70c6501723b6aa7a70
[ "MIT" ]
null
null
null
src/patterns/visitor/Node.java
dictxwang/java-design-patterns
b7836ee832a54bb5653b2c70c6501723b6aa7a70
[ "MIT" ]
null
null
null
15.285714
47
0.785047
1,003,216
package patterns.visitor; public abstract class Node { public abstract void accept(IVisitor visitor); }
92450657cb4b6c52d68bcdd7b575200cd7f6bbf4
2,293
java
Java
templating/thymeleaf-portlet-api/src/main/java/org/apache/pluto/thymeleaf/portlet/PortletMessageResolver.java
kimduquan/EPF-portal
ffd08d7ee4a40addf8498805d2a92912e769c93e
[ "Apache-2.0" ]
27
2015-08-26T17:55:02.000Z
2021-11-09T21:19:00.000Z
templating/thymeleaf-portlet-api/src/main/java/org/apache/pluto/thymeleaf/portlet/PortletMessageResolver.java
kimduquan/EPF-portal
ffd08d7ee4a40addf8498805d2a92912e769c93e
[ "Apache-2.0" ]
37
2016-12-02T00:29:29.000Z
2018-10-25T20:19:52.000Z
templating/thymeleaf-portlet-api/src/main/java/org/apache/pluto/thymeleaf/portlet/PortletMessageResolver.java
isabella232/portals-pluto
f32666586731297815202c4a9479a907f5108b6c
[ "Apache-2.0" ]
45
2015-07-10T07:09:46.000Z
2022-01-11T07:15:12.000Z
30.986486
118
0.756215
1,003,217
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.pluto.thymeleaf.portlet; import java.util.Enumeration; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import javax.portlet.PortletConfig; import org.thymeleaf.messageresolver.StandardMessageResolver; import org.thymeleaf.templateresource.ITemplateResource; /** * This is a convenient utility class that provides Thymeleaf with a way to resolve messages in a portlet application. * * @author Neil Griffin */ public class PortletMessageResolver extends StandardMessageResolver { private PortletConfig portletConfig; public PortletMessageResolver(PortletConfig portletConfig) { this.portletConfig = portletConfig; } @Override protected Map<String, String> resolveMessagesForTemplate(String template, ITemplateResource templateResource, Locale locale) { Map<String, String> messages = super.resolveMessagesForTemplate(template, templateResource, locale); if (messages.isEmpty()) { ResourceBundle resourceBundle = portletConfig.getResourceBundle(locale); if (resourceBundle != null) { messages = new HashMap<>(); Enumeration<String> resourceBundleKeys = resourceBundle.getKeys(); while (resourceBundleKeys.hasMoreElements()) { String key = resourceBundleKeys.nextElement(); Object value = resourceBundle.getObject(key); if ((key != null) && (value != null)) { messages.put(key, value.toString()); } } } } return messages; } }
92450785019d85da152a6ce455d284325a9c9dc8
1,013
java
Java
java/java.debug/src/org/netbeans/modules/java/debug/OffsetProvider.java
tusharvjoshi/incubator-netbeans
a61bd21f4324f7e73414633712522811cb20ac93
[ "Apache-2.0" ]
1,056
2019-04-25T20:00:35.000Z
2022-03-30T04:46:14.000Z
java/java.debug/src/org/netbeans/modules/java/debug/OffsetProvider.java
tusharvjoshi/incubator-netbeans
a61bd21f4324f7e73414633712522811cb20ac93
[ "Apache-2.0" ]
1,846
2019-04-25T20:50:05.000Z
2022-03-31T23:40:41.000Z
java/java.debug/src/org/netbeans/modules/java/debug/OffsetProvider.java
tusharvjoshi/incubator-netbeans
a61bd21f4324f7e73414633712522811cb20ac93
[ "Apache-2.0" ]
550
2019-04-25T20:04:33.000Z
2022-03-25T17:43:01.000Z
30.69697
63
0.736426
1,003,218
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.netbeans.modules.java.debug; /** * * @author Jan Lahoda */ public interface OffsetProvider { public int getStart(); public int getEnd(); public int getPreferredPosition(); }
92450797b7d2688ad7c58143e3374da0ff09ddc8
3,074
java
Java
perspective/src/main/java/org/netbeans/modules/perspective/views/LayerElement.java
timboudreau/netbeans-contrib
e414495e8585df9911392d7e3b190153759ff6d3
[ "Apache-2.0" ]
2
2018-07-19T08:40:29.000Z
2019-12-07T19:37:03.000Z
perspective/src/main/java/org/netbeans/modules/perspective/views/LayerElement.java
timboudreau/netbeans-contrib
e414495e8585df9911392d7e3b190153759ff6d3
[ "Apache-2.0" ]
4
2021-02-03T19:27:41.000Z
2021-08-02T17:04:13.000Z
perspective/src/main/java/org/netbeans/modules/perspective/views/LayerElement.java
timboudreau/netbeans-contrib
e414495e8585df9911392d7e3b190153759ff6d3
[ "Apache-2.0" ]
2
2020-10-03T14:44:58.000Z
2022-01-13T22:03:24.000Z
33.78022
72
0.718933
1,003,219
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common * Development and Distribution License("CDDL") (collectively, the * "License"). You may not use this file except in compliance with the * License. You can obtain a copy of the License at * http://www.netbeans.org/cddl-gplv2.html * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the * specific language governing permissions and limitations under the * License. When distributing the software, include this License Header * Notice in each file and include the License file at * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the * License Header, with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * If you wish your version of this file to be governed by only the CDDL * or only the GPL Version 2, indicate your decision by adding * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." If you do not indicate a * single choice of license, a recipient has the option to distribute * your version of this file under either the CDDL, the GPL Version 2 or * to extend the choice of license to its licensees as provided above. * However, if you add GPL Version 2 code and therefore, elected the GPL * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. * * Contributor(s): * * Portions Copyrighted 2007 Sun Microsystems, Inc. */ package org.netbeans.modules.perspective.views; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * * @author Anuradha G */ public class LayerElement { private String name; private boolean hidden; private List<LayerElement> childern = new ArrayList<LayerElement>(); private LayerElement alterPath; public LayerElement(String name) { this.name = name; } public String getName() { return name; } public boolean isHidden() { return hidden; } public void setHidden(boolean hidden) { this.hidden = hidden; } public List<LayerElement> getChildern() { return Collections.unmodifiableList(childern); } public LayerElement getAlterPath() { return alterPath; } public void setAlterPath(LayerElement alterPath) { this.alterPath = alterPath; } public void addLayerElement(LayerElement element) { childern.add(element); } public void removeLayerElement(LayerElement element) { childern.remove(element); } }
92450801658b57c0f41135a019310b128825ce8c
1,198
java
Java
Java-Kotlin/src/main/java/jianzhi/jz25.java
jamesxuhaozhe/LeetCode-Java-Kotlin
ea4c60f8f78b42081430b99e0c766c0513461877
[ "MIT" ]
4
2019-07-19T02:37:42.000Z
2019-08-05T05:09:04.000Z
Java-Kotlin/src/main/java/jianzhi/jz25.java
jamesxuhaozhe/LeetCode-Java-Kotlin
ea4c60f8f78b42081430b99e0c766c0513461877
[ "MIT" ]
4
2019-07-18T00:57:29.000Z
2020-06-28T04:29:12.000Z
Java-Kotlin/src/main/java/jianzhi/jz25.java
jamesxuhaozhe/LeetCode-Java-Kotlin
ea4c60f8f78b42081430b99e0c766c0513461877
[ "MIT" ]
null
null
null
28.52381
90
0.595993
1,003,220
package jianzhi; import common.datastructure.RandomListNode; public class jz25 { public RandomListNode Clone(RandomListNode pHead) { if (pHead == null) { return null; } RandomListNode currentNode = pHead; while (currentNode != null) { RandomListNode copyNode = new RandomListNode(currentNode.label); RandomListNode next = currentNode.next; currentNode.next = copyNode; copyNode.next = next; currentNode = next; } currentNode = pHead; while (currentNode != null) { RandomListNode copyNode = currentNode.next; copyNode.random = currentNode.random == null ? null : currentNode.random.next; currentNode = copyNode.next; } RandomListNode clonedHead = pHead.next; currentNode = pHead; while (currentNode != null) { RandomListNode clonedNode = currentNode.next; currentNode.next = clonedNode.next; clonedNode.next = clonedNode.next == null ? null : clonedNode.next.next; currentNode = currentNode.next; } return clonedHead; } }
92450817daba70b655ac9f45f687c2de753fa8c9
384
java
Java
app/base.core/src/main/java/eapli/base/gestaoordensproducao/fileImporters/ImportarOrdemProducaoFactory.java
joaomfas/LAPR4-2019-2020
a80ec45b48c16c9f22c12cf1336b2da3e9511525
[ "MIT" ]
null
null
null
app/base.core/src/main/java/eapli/base/gestaoordensproducao/fileImporters/ImportarOrdemProducaoFactory.java
joaomfas/LAPR4-2019-2020
a80ec45b48c16c9f22c12cf1336b2da3e9511525
[ "MIT" ]
null
null
null
app/base.core/src/main/java/eapli/base/gestaoordensproducao/fileImporters/ImportarOrdemProducaoFactory.java
joaomfas/LAPR4-2019-2020
a80ec45b48c16c9f22c12cf1336b2da3e9511525
[ "MIT" ]
null
null
null
22.588235
66
0.664063
1,003,221
package eapli.base.gestaoordensproducao.fileImporters; /** * * @author mdias */ public class ImportarOrdemProducaoFactory { public final IOrdemProducaoImporter build(FileFormat formato){ switch (formato) { case CSV: return new CSVOrdemProducaoImporter(); } throw new IllegalStateException("Formato desconhecido!"); } }
92450861b6f7658de0cbc6c6e88a6d19b042e13a
3,717
java
Java
src/main/java/io/fouad/jtb/core/beans/Document.java
hoota/JTelegramBot
6145ed1eb5c60c26223f23daec442371019b48ce
[ "MIT" ]
90
2016-05-17T17:21:25.000Z
2021-11-19T12:03:17.000Z
src/main/java/io/fouad/jtb/core/beans/Document.java
hoota/JTelegramBot
6145ed1eb5c60c26223f23daec442371019b48ce
[ "MIT" ]
7
2016-12-16T08:46:26.000Z
2018-10-04T15:55:00.000Z
src/main/java/io/fouad/jtb/core/beans/Document.java
hoota/JTelegramBot
6145ed1eb5c60c26223f23daec442371019b48ce
[ "MIT" ]
31
2016-06-23T19:51:57.000Z
2021-11-24T09:57:50.000Z
30.975
102
0.694377
1,003,222
/* * The MIT License (MIT) * * Copyright (c) 2016 Fouad Almalki * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package io.fouad.jtb.core.beans; import com.fasterxml.jackson.annotation.JsonProperty; /** * This object represents a general file (as opposed to photos, * voice messages and audio files). */ public class Document { /** * Unique file identifier. */ @JsonProperty("file_id") private String fileId; /** * Optional. Document thumbnail as defined by sender. */ @JsonProperty("thumb") private PhotoSize thumb; /** * Optional. Original filename as defined by sender. */ @JsonProperty("file_name") private String fileName; /** * Optional. MIME type of the file as defined by sender. */ @JsonProperty("mime_type") private String mimeType; /** * Optional. TelegramFile size. */ @JsonProperty("file_size") private Integer fileSize; public Document(){} public Document(String fileId, PhotoSize thumb, String fileName, String mimeType, Integer fileSize) { this.fileId = fileId; this.thumb = thumb; this.fileName = fileName; this.mimeType = mimeType; this.fileSize = fileSize; } public String getFileId(){return fileId;} public PhotoSize getThumb(){return thumb;} public String getFileName(){return fileName;} public String getMimeType(){return mimeType;} public Integer getFileSize(){return fileSize;} @Override public boolean equals(Object o) { if(this == o) return true; if(o == null || getClass() != o.getClass()) return false; Document document = (Document) o; if(fileId != null ? !fileId.equals(document.fileId) : document.fileId != null) return false; if(thumb != null ? !thumb.equals(document.thumb) : document.thumb != null) return false; if(fileName != null ? !fileName.equals(document.fileName) : document.fileName != null) return false; if(mimeType != null ? !mimeType.equals(document.mimeType) : document.mimeType != null) return false; return fileSize != null ? fileSize.equals(document.fileSize) : document.fileSize == null; } @Override public int hashCode() { int result = fileId != null ? fileId.hashCode() : 0; result = 31 * result + (thumb != null ? thumb.hashCode() : 0); result = 31 * result + (fileName != null ? fileName.hashCode() : 0); result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0); result = 31 * result + (fileSize != null ? fileSize.hashCode() : 0); return result; } @Override public String toString() { return "Document{" + "fileId='" + fileId + '\'' + ", thumb=" + thumb + ", fileName='" + fileName + '\'' + ", mimeType='" + mimeType + '\'' + ", fileSize=" + fileSize + '}'; } }
9245087ffd8ab5db2dfeb1429e771dabd3d88b1e
1,255
java
Java
dionne-client/src/main/java/com/vivvo/userservice/UserClient.java
ItzProxy/HackathonJan12
7c6ce5abbd7d5703d29f19122a04751f7d56ae55
[ "MIT" ]
null
null
null
dionne-client/src/main/java/com/vivvo/userservice/UserClient.java
ItzProxy/HackathonJan12
7c6ce5abbd7d5703d29f19122a04751f7d56ae55
[ "MIT" ]
null
null
null
dionne-client/src/main/java/com/vivvo/userservice/UserClient.java
ItzProxy/HackathonJan12
7c6ce5abbd7d5703d29f19122a04751f7d56ae55
[ "MIT" ]
null
null
null
23.679245
57
0.553785
1,003,223
package com.vivvo.userservice; import lombok.Setter; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.GenericType; import java.util.List; import java.util.UUID; public class UserClient { @Setter private String baseUri = "http://localhost:4444"; public UserDto create(UserDto dto) { return userTarget() .request() .post(Entity.json(dto), UserDto.class); } public UserDto update(UserDto dto) { return userTarget() .path(dto.getUserId().toString()) .request() .put(Entity.json(dto), UserDto.class); } public void delete(UUID userId) { userTarget() .path(userId.toString()) .request() .delete(Void.class); } public List<UserDto> findAddUsers() { return userTarget() .request() .get(new GenericType<List<UserDto>>(){}); } private WebTarget userTarget() { return ClientBuilder.newClient() .target(baseUri) .path("api") .path("v1") .path("users"); } }
924508dd24d0ad56d19af1c47c59976d47456088
11,453
java
Java
src/main/java/com/zfgc/dbobj/UserSecuritySettingsDbObj.java
ZFGCCP/ZFGC3
e2a30779cdb9fab2918739a316a013239fe18121
[ "MIT" ]
4
2015-07-02T03:55:28.000Z
2019-09-01T05:57:42.000Z
src/main/java/com/zfgc/dbobj/UserSecuritySettingsDbObj.java
ZFGCCP/ZFGC3
e2a30779cdb9fab2918739a316a013239fe18121
[ "MIT" ]
199
2015-12-18T06:18:02.000Z
2022-02-26T10:33:08.000Z
src/main/java/com/zfgc/dbobj/UserSecuritySettingsDbObj.java
ZFGCCP/ZFGC3
e2a30779cdb9fab2918739a316a013239fe18121
[ "MIT" ]
1
2019-05-24T23:51:30.000Z
2019-05-24T23:51:30.000Z
40.758007
153
0.775692
1,003,224
package com.zfgc.dbobj; public class UserSecuritySettingsDbObj { /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.USER_SECURITY_SETTINGS_ID * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Integer userSecuritySettingsId; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.USERS_ID * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Integer usersId; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_SKYPE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideSkypeFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_GTALK_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideGtalkFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_STEAM_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideSteamFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_NNID_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideNnidFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_PSN_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hidePsnFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_XBOX_LIVE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideXboxLiveFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_GENDER_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideGenderFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_BIRTH_DATE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideBirthDateFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_FACEBOOK_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideFacebookFlag; /** * This field was generated by MyBatis Generator. This field corresponds to the database column USER_SECURITY_SETTINGS.HIDE_EMAIL_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ private Boolean hideEmailFlag; /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.USER_SECURITY_SETTINGS_ID * @return the value of USER_SECURITY_SETTINGS.USER_SECURITY_SETTINGS_ID * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Integer getUserSecuritySettingsId() { return userSecuritySettingsId; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.USER_SECURITY_SETTINGS_ID * @param userSecuritySettingsId the value for USER_SECURITY_SETTINGS.USER_SECURITY_SETTINGS_ID * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setUserSecuritySettingsId(Integer userSecuritySettingsId) { this.userSecuritySettingsId = userSecuritySettingsId; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.USERS_ID * @return the value of USER_SECURITY_SETTINGS.USERS_ID * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Integer getUsersId() { return usersId; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.USERS_ID * @param usersId the value for USER_SECURITY_SETTINGS.USERS_ID * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setUsersId(Integer usersId) { this.usersId = usersId; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_SKYPE_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_SKYPE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideSkypeFlag() { return hideSkypeFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_SKYPE_FLAG * @param hideSkypeFlag the value for USER_SECURITY_SETTINGS.HIDE_SKYPE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideSkypeFlag(Boolean hideSkypeFlag) { this.hideSkypeFlag = hideSkypeFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_GTALK_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_GTALK_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideGtalkFlag() { return hideGtalkFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_GTALK_FLAG * @param hideGtalkFlag the value for USER_SECURITY_SETTINGS.HIDE_GTALK_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideGtalkFlag(Boolean hideGtalkFlag) { this.hideGtalkFlag = hideGtalkFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_STEAM_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_STEAM_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideSteamFlag() { return hideSteamFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_STEAM_FLAG * @param hideSteamFlag the value for USER_SECURITY_SETTINGS.HIDE_STEAM_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideSteamFlag(Boolean hideSteamFlag) { this.hideSteamFlag = hideSteamFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_NNID_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_NNID_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideNnidFlag() { return hideNnidFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_NNID_FLAG * @param hideNnidFlag the value for USER_SECURITY_SETTINGS.HIDE_NNID_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideNnidFlag(Boolean hideNnidFlag) { this.hideNnidFlag = hideNnidFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_PSN_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_PSN_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHidePsnFlag() { return hidePsnFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_PSN_FLAG * @param hidePsnFlag the value for USER_SECURITY_SETTINGS.HIDE_PSN_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHidePsnFlag(Boolean hidePsnFlag) { this.hidePsnFlag = hidePsnFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_XBOX_LIVE_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_XBOX_LIVE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideXboxLiveFlag() { return hideXboxLiveFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_XBOX_LIVE_FLAG * @param hideXboxLiveFlag the value for USER_SECURITY_SETTINGS.HIDE_XBOX_LIVE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideXboxLiveFlag(Boolean hideXboxLiveFlag) { this.hideXboxLiveFlag = hideXboxLiveFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_GENDER_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_GENDER_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideGenderFlag() { return hideGenderFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_GENDER_FLAG * @param hideGenderFlag the value for USER_SECURITY_SETTINGS.HIDE_GENDER_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideGenderFlag(Boolean hideGenderFlag) { this.hideGenderFlag = hideGenderFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_BIRTH_DATE_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_BIRTH_DATE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideBirthDateFlag() { return hideBirthDateFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_BIRTH_DATE_FLAG * @param hideBirthDateFlag the value for USER_SECURITY_SETTINGS.HIDE_BIRTH_DATE_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideBirthDateFlag(Boolean hideBirthDateFlag) { this.hideBirthDateFlag = hideBirthDateFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_FACEBOOK_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_FACEBOOK_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideFacebookFlag() { return hideFacebookFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_FACEBOOK_FLAG * @param hideFacebookFlag the value for USER_SECURITY_SETTINGS.HIDE_FACEBOOK_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideFacebookFlag(Boolean hideFacebookFlag) { this.hideFacebookFlag = hideFacebookFlag; } /** * This method was generated by MyBatis Generator. This method returns the value of the database column USER_SECURITY_SETTINGS.HIDE_EMAIL_FLAG * @return the value of USER_SECURITY_SETTINGS.HIDE_EMAIL_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public Boolean getHideEmailFlag() { return hideEmailFlag; } /** * This method was generated by MyBatis Generator. This method sets the value of the database column USER_SECURITY_SETTINGS.HIDE_EMAIL_FLAG * @param hideEmailFlag the value for USER_SECURITY_SETTINGS.HIDE_EMAIL_FLAG * @mbg.generated Sun Mar 31 13:23:26 EDT 2019 */ public void setHideEmailFlag(Boolean hideEmailFlag) { this.hideEmailFlag = hideEmailFlag; } }
92450a57f97dbe570183a5e26d9e32cab5370fb9
15,610
java
Java
src/main/java/com/microsoft/schemas/office/visio/x2012/main/DataRecordSetType.java
pjfanning/poi-ooxml-lite-build
34af44251cb99fcdf8de2f844af686da8870e7db
[ "Apache-2.0" ]
null
null
null
src/main/java/com/microsoft/schemas/office/visio/x2012/main/DataRecordSetType.java
pjfanning/poi-ooxml-lite-build
34af44251cb99fcdf8de2f844af686da8870e7db
[ "Apache-2.0" ]
null
null
null
src/main/java/com/microsoft/schemas/office/visio/x2012/main/DataRecordSetType.java
pjfanning/poi-ooxml-lite-build
34af44251cb99fcdf8de2f844af686da8870e7db
[ "Apache-2.0" ]
null
null
null
25.340909
217
0.648943
1,003,225
/* * XML Type: DataRecordSet_Type * Namespace: http://schemas.microsoft.com/office/visio/2012/main * Java type: com.microsoft.schemas.office.visio.x2012.main.DataRecordSetType * * Automatically generated - do not modify. */ package com.microsoft.schemas.office.visio.x2012.main; import org.apache.xmlbeans.impl.schema.ElementFactory; import org.apache.xmlbeans.impl.schema.AbstractDocumentFactory; import org.apache.xmlbeans.impl.schema.DocumentFactory; import org.apache.xmlbeans.impl.schema.SimpleTypeFactory; /** * An XML DataRecordSet_Type(@http://schemas.microsoft.com/office/visio/2012/main). * * This is a complex type. */ public interface DataRecordSetType extends org.apache.xmlbeans.XmlObject { DocumentFactory<com.microsoft.schemas.office.visio.x2012.main.DataRecordSetType> Factory = new DocumentFactory<>(org.apache.poi.schemas.ooxml.system.ooxml.TypeSystemHolder.typeSystem, "datarecordsettype3544type"); org.apache.xmlbeans.SchemaType type = Factory.getType(); /** * Gets the "Rel" element */ com.microsoft.schemas.office.visio.x2012.main.RelType getRel(); /** * Sets the "Rel" element */ void setRel(com.microsoft.schemas.office.visio.x2012.main.RelType rel); /** * Appends and returns a new empty "Rel" element */ com.microsoft.schemas.office.visio.x2012.main.RelType addNewRel(); /** * Gets the "DataColumns" element */ com.microsoft.schemas.office.visio.x2012.main.DataColumnsType getDataColumns(); /** * Sets the "DataColumns" element */ void setDataColumns(com.microsoft.schemas.office.visio.x2012.main.DataColumnsType dataColumns); /** * Appends and returns a new empty "DataColumns" element */ com.microsoft.schemas.office.visio.x2012.main.DataColumnsType addNewDataColumns(); /** * Gets a List of "PrimaryKey" elements */ java.util.List<com.microsoft.schemas.office.visio.x2012.main.PrimaryKeyType> getPrimaryKeyList(); /** * Gets array of all "PrimaryKey" elements */ com.microsoft.schemas.office.visio.x2012.main.PrimaryKeyType[] getPrimaryKeyArray(); /** * Gets ith "PrimaryKey" element */ com.microsoft.schemas.office.visio.x2012.main.PrimaryKeyType getPrimaryKeyArray(int i); /** * Returns number of "PrimaryKey" element */ int sizeOfPrimaryKeyArray(); /** * Sets array of all "PrimaryKey" element */ void setPrimaryKeyArray(com.microsoft.schemas.office.visio.x2012.main.PrimaryKeyType[] primaryKeyArray); /** * Sets ith "PrimaryKey" element */ void setPrimaryKeyArray(int i, com.microsoft.schemas.office.visio.x2012.main.PrimaryKeyType primaryKey); /** * Inserts and returns a new empty value (as xml) as the ith "PrimaryKey" element */ com.microsoft.schemas.office.visio.x2012.main.PrimaryKeyType insertNewPrimaryKey(int i); /** * Appends and returns a new empty value (as xml) as the last "PrimaryKey" element */ com.microsoft.schemas.office.visio.x2012.main.PrimaryKeyType addNewPrimaryKey(); /** * Removes the ith "PrimaryKey" element */ void removePrimaryKey(int i); /** * Gets a List of "RowMap" elements */ java.util.List<com.microsoft.schemas.office.visio.x2012.main.RowMapType> getRowMapList(); /** * Gets array of all "RowMap" elements */ com.microsoft.schemas.office.visio.x2012.main.RowMapType[] getRowMapArray(); /** * Gets ith "RowMap" element */ com.microsoft.schemas.office.visio.x2012.main.RowMapType getRowMapArray(int i); /** * Returns number of "RowMap" element */ int sizeOfRowMapArray(); /** * Sets array of all "RowMap" element */ void setRowMapArray(com.microsoft.schemas.office.visio.x2012.main.RowMapType[] rowMapArray); /** * Sets ith "RowMap" element */ void setRowMapArray(int i, com.microsoft.schemas.office.visio.x2012.main.RowMapType rowMap); /** * Inserts and returns a new empty value (as xml) as the ith "RowMap" element */ com.microsoft.schemas.office.visio.x2012.main.RowMapType insertNewRowMap(int i); /** * Appends and returns a new empty value (as xml) as the last "RowMap" element */ com.microsoft.schemas.office.visio.x2012.main.RowMapType addNewRowMap(); /** * Removes the ith "RowMap" element */ void removeRowMap(int i); /** * Gets a List of "RefreshConflict" elements */ java.util.List<com.microsoft.schemas.office.visio.x2012.main.RefreshConflictType> getRefreshConflictList(); /** * Gets array of all "RefreshConflict" elements */ com.microsoft.schemas.office.visio.x2012.main.RefreshConflictType[] getRefreshConflictArray(); /** * Gets ith "RefreshConflict" element */ com.microsoft.schemas.office.visio.x2012.main.RefreshConflictType getRefreshConflictArray(int i); /** * Returns number of "RefreshConflict" element */ int sizeOfRefreshConflictArray(); /** * Sets array of all "RefreshConflict" element */ void setRefreshConflictArray(com.microsoft.schemas.office.visio.x2012.main.RefreshConflictType[] refreshConflictArray); /** * Sets ith "RefreshConflict" element */ void setRefreshConflictArray(int i, com.microsoft.schemas.office.visio.x2012.main.RefreshConflictType refreshConflict); /** * Inserts and returns a new empty value (as xml) as the ith "RefreshConflict" element */ com.microsoft.schemas.office.visio.x2012.main.RefreshConflictType insertNewRefreshConflict(int i); /** * Appends and returns a new empty value (as xml) as the last "RefreshConflict" element */ com.microsoft.schemas.office.visio.x2012.main.RefreshConflictType addNewRefreshConflict(); /** * Removes the ith "RefreshConflict" element */ void removeRefreshConflict(int i); /** * Gets a List of "AutoLinkComparison" elements */ java.util.List<com.microsoft.schemas.office.visio.x2012.main.AutoLinkComparisonType> getAutoLinkComparisonList(); /** * Gets array of all "AutoLinkComparison" elements */ com.microsoft.schemas.office.visio.x2012.main.AutoLinkComparisonType[] getAutoLinkComparisonArray(); /** * Gets ith "AutoLinkComparison" element */ com.microsoft.schemas.office.visio.x2012.main.AutoLinkComparisonType getAutoLinkComparisonArray(int i); /** * Returns number of "AutoLinkComparison" element */ int sizeOfAutoLinkComparisonArray(); /** * Sets array of all "AutoLinkComparison" element */ void setAutoLinkComparisonArray(com.microsoft.schemas.office.visio.x2012.main.AutoLinkComparisonType[] autoLinkComparisonArray); /** * Sets ith "AutoLinkComparison" element */ void setAutoLinkComparisonArray(int i, com.microsoft.schemas.office.visio.x2012.main.AutoLinkComparisonType autoLinkComparison); /** * Inserts and returns a new empty value (as xml) as the ith "AutoLinkComparison" element */ com.microsoft.schemas.office.visio.x2012.main.AutoLinkComparisonType insertNewAutoLinkComparison(int i); /** * Appends and returns a new empty value (as xml) as the last "AutoLinkComparison" element */ com.microsoft.schemas.office.visio.x2012.main.AutoLinkComparisonType addNewAutoLinkComparison(); /** * Removes the ith "AutoLinkComparison" element */ void removeAutoLinkComparison(int i); /** * Gets the "ID" attribute */ long getID(); /** * Gets (as xml) the "ID" attribute */ org.apache.xmlbeans.XmlUnsignedInt xgetID(); /** * Sets the "ID" attribute */ void setID(long id); /** * Sets (as xml) the "ID" attribute */ void xsetID(org.apache.xmlbeans.XmlUnsignedInt id); /** * Gets the "ConnectionID" attribute */ long getConnectionID(); /** * Gets (as xml) the "ConnectionID" attribute */ org.apache.xmlbeans.XmlUnsignedInt xgetConnectionID(); /** * True if has "ConnectionID" attribute */ boolean isSetConnectionID(); /** * Sets the "ConnectionID" attribute */ void setConnectionID(long connectionID); /** * Sets (as xml) the "ConnectionID" attribute */ void xsetConnectionID(org.apache.xmlbeans.XmlUnsignedInt connectionID); /** * Unsets the "ConnectionID" attribute */ void unsetConnectionID(); /** * Gets the "Command" attribute */ java.lang.String getCommand(); /** * Gets (as xml) the "Command" attribute */ org.apache.xmlbeans.XmlString xgetCommand(); /** * True if has "Command" attribute */ boolean isSetCommand(); /** * Sets the "Command" attribute */ void setCommand(java.lang.String command); /** * Sets (as xml) the "Command" attribute */ void xsetCommand(org.apache.xmlbeans.XmlString command); /** * Unsets the "Command" attribute */ void unsetCommand(); /** * Gets the "Options" attribute */ long getOptions(); /** * Gets (as xml) the "Options" attribute */ org.apache.xmlbeans.XmlUnsignedInt xgetOptions(); /** * True if has "Options" attribute */ boolean isSetOptions(); /** * Sets the "Options" attribute */ void setOptions(long options); /** * Sets (as xml) the "Options" attribute */ void xsetOptions(org.apache.xmlbeans.XmlUnsignedInt options); /** * Unsets the "Options" attribute */ void unsetOptions(); /** * Gets the "TimeRefreshed" attribute */ java.util.Calendar getTimeRefreshed(); /** * Gets (as xml) the "TimeRefreshed" attribute */ org.apache.xmlbeans.XmlDateTime xgetTimeRefreshed(); /** * True if has "TimeRefreshed" attribute */ boolean isSetTimeRefreshed(); /** * Sets the "TimeRefreshed" attribute */ void setTimeRefreshed(java.util.Calendar timeRefreshed); /** * Sets (as xml) the "TimeRefreshed" attribute */ void xsetTimeRefreshed(org.apache.xmlbeans.XmlDateTime timeRefreshed); /** * Unsets the "TimeRefreshed" attribute */ void unsetTimeRefreshed(); /** * Gets the "NextRowID" attribute */ long getNextRowID(); /** * Gets (as xml) the "NextRowID" attribute */ org.apache.xmlbeans.XmlUnsignedInt xgetNextRowID(); /** * True if has "NextRowID" attribute */ boolean isSetNextRowID(); /** * Sets the "NextRowID" attribute */ void setNextRowID(long nextRowID); /** * Sets (as xml) the "NextRowID" attribute */ void xsetNextRowID(org.apache.xmlbeans.XmlUnsignedInt nextRowID); /** * Unsets the "NextRowID" attribute */ void unsetNextRowID(); /** * Gets the "Name" attribute */ java.lang.String getName(); /** * Gets (as xml) the "Name" attribute */ org.apache.xmlbeans.XmlString xgetName(); /** * True if has "Name" attribute */ boolean isSetName(); /** * Sets the "Name" attribute */ void setName(java.lang.String name); /** * Sets (as xml) the "Name" attribute */ void xsetName(org.apache.xmlbeans.XmlString name); /** * Unsets the "Name" attribute */ void unsetName(); /** * Gets the "RowOrder" attribute */ boolean getRowOrder(); /** * Gets (as xml) the "RowOrder" attribute */ org.apache.xmlbeans.XmlBoolean xgetRowOrder(); /** * True if has "RowOrder" attribute */ boolean isSetRowOrder(); /** * Sets the "RowOrder" attribute */ void setRowOrder(boolean rowOrder); /** * Sets (as xml) the "RowOrder" attribute */ void xsetRowOrder(org.apache.xmlbeans.XmlBoolean rowOrder); /** * Unsets the "RowOrder" attribute */ void unsetRowOrder(); /** * Gets the "RefreshOverwriteAll" attribute */ boolean getRefreshOverwriteAll(); /** * Gets (as xml) the "RefreshOverwriteAll" attribute */ org.apache.xmlbeans.XmlBoolean xgetRefreshOverwriteAll(); /** * True if has "RefreshOverwriteAll" attribute */ boolean isSetRefreshOverwriteAll(); /** * Sets the "RefreshOverwriteAll" attribute */ void setRefreshOverwriteAll(boolean refreshOverwriteAll); /** * Sets (as xml) the "RefreshOverwriteAll" attribute */ void xsetRefreshOverwriteAll(org.apache.xmlbeans.XmlBoolean refreshOverwriteAll); /** * Unsets the "RefreshOverwriteAll" attribute */ void unsetRefreshOverwriteAll(); /** * Gets the "RefreshNoReconciliationUI" attribute */ boolean getRefreshNoReconciliationUI(); /** * Gets (as xml) the "RefreshNoReconciliationUI" attribute */ org.apache.xmlbeans.XmlBoolean xgetRefreshNoReconciliationUI(); /** * True if has "RefreshNoReconciliationUI" attribute */ boolean isSetRefreshNoReconciliationUI(); /** * Sets the "RefreshNoReconciliationUI" attribute */ void setRefreshNoReconciliationUI(boolean refreshNoReconciliationUI); /** * Sets (as xml) the "RefreshNoReconciliationUI" attribute */ void xsetRefreshNoReconciliationUI(org.apache.xmlbeans.XmlBoolean refreshNoReconciliationUI); /** * Unsets the "RefreshNoReconciliationUI" attribute */ void unsetRefreshNoReconciliationUI(); /** * Gets the "RefreshInterval" attribute */ long getRefreshInterval(); /** * Gets (as xml) the "RefreshInterval" attribute */ org.apache.xmlbeans.XmlUnsignedInt xgetRefreshInterval(); /** * True if has "RefreshInterval" attribute */ boolean isSetRefreshInterval(); /** * Sets the "RefreshInterval" attribute */ void setRefreshInterval(long refreshInterval); /** * Sets (as xml) the "RefreshInterval" attribute */ void xsetRefreshInterval(org.apache.xmlbeans.XmlUnsignedInt refreshInterval); /** * Unsets the "RefreshInterval" attribute */ void unsetRefreshInterval(); /** * Gets the "ReplaceLinks" attribute */ long getReplaceLinks(); /** * Gets (as xml) the "ReplaceLinks" attribute */ org.apache.xmlbeans.XmlUnsignedInt xgetReplaceLinks(); /** * True if has "ReplaceLinks" attribute */ boolean isSetReplaceLinks(); /** * Sets the "ReplaceLinks" attribute */ void setReplaceLinks(long replaceLinks); /** * Sets (as xml) the "ReplaceLinks" attribute */ void xsetReplaceLinks(org.apache.xmlbeans.XmlUnsignedInt replaceLinks); /** * Unsets the "ReplaceLinks" attribute */ void unsetReplaceLinks(); /** * Gets the "Checksum" attribute */ long getChecksum(); /** * Gets (as xml) the "Checksum" attribute */ org.apache.xmlbeans.XmlUnsignedInt xgetChecksum(); /** * True if has "Checksum" attribute */ boolean isSetChecksum(); /** * Sets the "Checksum" attribute */ void setChecksum(long checksum); /** * Sets (as xml) the "Checksum" attribute */ void xsetChecksum(org.apache.xmlbeans.XmlUnsignedInt checksum); /** * Unsets the "Checksum" attribute */ void unsetChecksum(); }
92450a87dc4e365da9dea2c45b42a5a5c68e8209
1,149
java
Java
ReactAndroid/src/main/java/com/facebook/fbreact/specs/NativeDevMenuSpec.java
sjchmiela/react-native
9d6d39de86057f92d41a9f7eed7fdddf1ac09582
[ "CC-BY-4.0", "MIT" ]
456
2020-09-07T05:26:22.000Z
2022-03-29T06:43:13.000Z
ReactAndroid/src/main/java/com/facebook/fbreact/specs/NativeDevMenuSpec.java
sjchmiela/react-native
9d6d39de86057f92d41a9f7eed7fdddf1ac09582
[ "CC-BY-4.0", "MIT" ]
23
2021-01-03T07:48:10.000Z
2022-03-29T11:42:12.000Z
ReactAndroid/src/main/java/com/facebook/fbreact/specs/NativeDevMenuSpec.java
sjchmiela/react-native
9d6d39de86057f92d41a9f7eed7fdddf1ac09582
[ "CC-BY-4.0", "MIT" ]
228
2020-10-07T17:15:26.000Z
2022-03-25T18:09:28.000Z
28.02439
120
0.790252
1,003,226
/** * Copyright (c) Facebook, Inc. and its affiliates. * * <p>This source code is licensed under the MIT license found in the LICENSE file in the root * directory of this source tree. * * <p>Generated by an internal genrule from Flow types. * * @generated * @nolint */ package com.facebook.fbreact.specs; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReactModuleWithSpec; import com.facebook.react.turbomodule.core.interfaces.TurboModule; public abstract class NativeDevMenuSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule { public NativeDevMenuSpec(ReactApplicationContext reactContext) { super(reactContext); } @ReactMethod public abstract void reload(); @ReactMethod public abstract void debugRemotely(boolean enableDebug); @ReactMethod public abstract void setProfilingEnabled(boolean enabled); @ReactMethod public abstract void show(); @ReactMethod public abstract void setHotLoadingEnabled(boolean enabled); }
92450acdcd8ebe0a80eb86eb4f81f4619ca0ec95
694
java
Java
Rz Rasel - 2017-08-21/NavigationDrawerOne/app/src/main/java/com/sm/navigationdrawerone/DynamicModel.java
rzrasel/Android-Utility-Class
545d8a1d60ec954428b477bbdef2b789b99e8259
[ "Apache-2.0" ]
null
null
null
Rz Rasel - 2017-08-21/NavigationDrawerOne/app/src/main/java/com/sm/navigationdrawerone/DynamicModel.java
rzrasel/Android-Utility-Class
545d8a1d60ec954428b477bbdef2b789b99e8259
[ "Apache-2.0" ]
null
null
null
Rz Rasel - 2017-08-21/NavigationDrawerOne/app/src/main/java/com/sm/navigationdrawerone/DynamicModel.java
rzrasel/Android-Utility-Class
545d8a1d60ec954428b477bbdef2b789b99e8259
[ "Apache-2.0" ]
null
null
null
19.828571
65
0.636888
1,003,227
package com.sm.navigationdrawerone; /** * Created by Rz Rasel on 2017-08-21. */ public class DynamicModel { private String title; private String description; public DynamicModel() { // } public DynamicModel(String argTitle, String argDescription) { this.title = argTitle; this.description = argDescription; } public void setTitle(String argTitle) { this.title = argTitle; } public String getTitle() { return this.title; } public String getDescription() { return this.description; } public void setDescription(String argDescription) { this.description = argDescription; } }
92450b4f532385e634596d63cd53d0af8a385ea8
4,473
java
Java
src/main/java/de/fs92/defi/util/Ethereum.java
FabianSchuessler/java-defi-bot
2fc620bd849817853f78a2a41bca414a125d3b52
[ "MIT" ]
17
2020-05-21T10:49:21.000Z
2022-01-20T07:10:57.000Z
src/main/java/de/fs92/defi/util/Ethereum.java
iikirilov/java-defi-bot
2fc620bd849817853f78a2a41bca414a125d3b52
[ "MIT" ]
1
2020-05-01T13:23:36.000Z
2020-05-02T20:35:55.000Z
src/main/java/de/fs92/defi/util/Ethereum.java
iikirilov/java-defi-bot
2fc620bd849817853f78a2a41bca414a125d3b52
[ "MIT" ]
8
2020-07-13T13:28:19.000Z
2022-02-26T20:13:21.000Z
36.072581
99
0.707579
1,003,228
package de.fs92.defi.util; import de.fs92.defi.contractneedsprovider.ContractNeedsProvider; import de.fs92.defi.contractneedsprovider.Permissions; import de.fs92.defi.medianizer.MedianException; import de.fs92.defi.numberutil.Wad18; import org.jetbrains.annotations.NotNull; import org.slf4j.LoggerFactory; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3j; import org.web3j.protocol.core.DefaultBlockParameterName; import org.web3j.protocol.core.methods.response.TransactionReceipt; import org.web3j.tx.Transfer; import org.web3j.utils.Convert; import java.io.IOException; import java.lang.invoke.MethodHandles; import java.math.BigDecimal; import java.math.BigInteger; import static de.fs92.defi.numberutil.NumberUtil.getMachineReadable; public class Ethereum { private static final org.slf4j.Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass().getSimpleName()); public final Wad18 minimumEthereumReserveUpperLimit; public final Wad18 minimumEthereumReserveLowerLimit; public final Wad18 minimumEthereumNecessaryForSale; private final Web3j web3j; private final Credentials credentials; private final Permissions permissions; private Wad18 balance; public Ethereum( @NotNull ContractNeedsProvider contractNeedsProvider, double minimumEthereumReserveUpperLimit, double minimumEthereumReserveLowerLimit, double minimumEthereumNecessaryForSale) { web3j = contractNeedsProvider.getWeb3j(); permissions = contractNeedsProvider.getPermissions(); credentials = contractNeedsProvider.getCredentials(); this.minimumEthereumReserveUpperLimit = new Wad18(getMachineReadable(minimumEthereumReserveUpperLimit)); this.minimumEthereumReserveLowerLimit = new Wad18(getMachineReadable(minimumEthereumReserveLowerLimit)); this.minimumEthereumNecessaryForSale = new Wad18(getMachineReadable(minimumEthereumNecessaryForSale)); balance = Wad18.ZERO; } public void sendTransaction() throws Exception { if (permissions.check("SEND TRANSACTION")) { logger.trace("Sending 1 Wei ({} Ether)", Convert.fromWei("1", Convert.Unit.ETHER)); TransactionReceipt transferReceipt = Transfer.sendFunds( web3j, credentials, credentials.getAddress(), // you can put any address here BigDecimal.ONE, Convert.Unit.WEI) // 1 wei = 10^-18 Ether, this is the amount sent .send(); logger.trace( "Transaction complete, view it at https://etherscan.io/tx/{}", transferReceipt.getTransactionHash()); logger.trace("end run()"); } } public void updateBalance() { Wad18 oldBalance = balance; // todo: use account try { balance = new Wad18( web3j .ethGetBalance(getAddress(), DefaultBlockParameterName.LATEST) .send() .getBalance()); } catch (IOException e) { logger.error("IOException", e); balance = Wad18.ZERO; // todo: if timeout, then shutdown -> BETTER: retry getting eth balance } if (oldBalance != null && oldBalance.compareTo(balance) != 0) { logger.trace("OLD BALANCE {} ETH", oldBalance); logger.trace("UPDATED BALANCE {} ETH", balance); } else if (oldBalance == null) { logger.trace("ETH BALANCE {} ETH", balance); } } public String getAddress() { return credentials.getAddress(); } public Wad18 getBalance() { if (balance.compareTo(Wad18.ZERO) != 0) logger.trace("ETH BALANCE {}{}", balance, " ETH"); return balance; } public Wad18 getBalanceWithoutMinimumEthereumReserveUpperLimit() { Wad18 balanceWithoutMinimumEthereumReserveUpperLimit = Wad18.ZERO.max(balance.subtract(minimumEthereumReserveUpperLimit)); if (balanceWithoutMinimumEthereumReserveUpperLimit.compareTo(Wad18.ZERO) != 0) logger.trace( "ETH BALANCE WITHOUT MINIMUM ETHEREUM RESERVER UPPER LIMIT {}{}", balanceWithoutMinimumEthereumReserveUpperLimit, " ETH"); return balanceWithoutMinimumEthereumReserveUpperLimit; } public BigInteger getCurrentBlock() throws MedianException { try { return web3j.ethBlockNumber().send().getBlockNumber(); } catch (Exception e) { logger.error("Exception", e); throw new MedianException("CAN'T GET CURRENT BLOCK"); } } }
92450c141a1e84efd7392187b04f8d20d0a0cfb9
861
java
Java
Sample_common/src/test/java/com/yuhs/utils/ssh/SSHUtilsTest.java
ukis-yuhs/springmvc
f5ee3a209a48ecf7c2d65740edf019b6c031b1a1
[ "MIT" ]
null
null
null
Sample_common/src/test/java/com/yuhs/utils/ssh/SSHUtilsTest.java
ukis-yuhs/springmvc
f5ee3a209a48ecf7c2d65740edf019b6c031b1a1
[ "MIT" ]
14
2020-03-04T22:37:02.000Z
2021-12-09T21:02:38.000Z
Sample_common/src/test/java/com/yuhs/utils/ssh/SSHUtilsTest.java
ukis-yuhs/springmvc
f5ee3a209a48ecf7c2d65740edf019b6c031b1a1
[ "MIT" ]
null
null
null
30.857143
90
0.510417
1,003,229
package com.yuhs.utils.ssh; import org.junit.Test; /** * Created by yuhaisheng on 2019/6/2. */ public class SSHUtilsTest { @Test public void test() { // SSHUtils s=new SSHUtils(); // try { // System.out.println(s.login("172.16.17.32", "runner", "")); // //s.downloadFile("/home/runner/checkorder/telecom/MXT371_20130901", "g://"); // System.out.println(s.ls("/home/runner").size()); // //s.createFile("/home/runner/acc.txt"); // //s.uploadFile("/home/runner/",new File( "d://first.log")); // //s.rm("/home/runner/c.a"); // //s.rmdir("/home/runner/aaa"); //// s.createFile("/home/runner/my.doc"); //// s.mv("/home/runner/my.doc", "cccccc"); // } catch (IOException e) { // e.printStackTrace(); // } } }
92450c27e974e62b36cc2cc4422bc86f935a87bb
3,891
java
Java
systemtests/src/test/java/io/enmasse/systemtest/standard/web/ChromeWebConsoleTest.java
ertanden/enmasse
81e40101e35ea5d9f42b5f44497bec170c646b85
[ "Apache-2.0" ]
null
null
null
systemtests/src/test/java/io/enmasse/systemtest/standard/web/ChromeWebConsoleTest.java
ertanden/enmasse
81e40101e35ea5d9f42b5f44497bec170c646b85
[ "Apache-2.0" ]
null
null
null
systemtests/src/test/java/io/enmasse/systemtest/standard/web/ChromeWebConsoleTest.java
ertanden/enmasse
81e40101e35ea5d9f42b5f44497bec170c646b85
[ "Apache-2.0" ]
null
null
null
26.650685
129
0.71267
1,003,230
/* * Copyright 2018, EnMasse authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.enmasse.systemtest.standard.web; import io.enmasse.systemtest.AddressType; import io.enmasse.systemtest.Destination; import io.enmasse.systemtest.KeycloakCredentials; import io.enmasse.systemtest.ability.ITestBaseStandard; import io.enmasse.systemtest.bases.web.WebConsoleTest; import io.enmasse.systemtest.selenium.ISeleniumProviderChrome; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertThrows; @Disabled("chromedriver does not wotk properly") public class ChromeWebConsoleTest extends WebConsoleTest implements ITestBaseStandard, ISeleniumProviderChrome { @Test void testCreateDeleteQueue() throws Exception { doTestCreateDeleteAddress(Destination.queue("test-queue", getDefaultPlan(AddressType.QUEUE))); } @Test void testCreateDeleteTopic() throws Exception { doTestCreateDeleteAddress(Destination.topic("test-topic", getDefaultPlan(AddressType.TOPIC))); } @Test void testCreateDeleteAnycast() throws Exception { doTestCreateDeleteAddress(Destination.anycast("test-anycast-firefox")); } @Test void testCreateDeleteMulticast() throws Exception { doTestCreateDeleteAddress(Destination.multicast("test-multicast-firefox")); } @Test void testFilterAddressesByType() throws Exception { doTestFilterAddressesByType(); } @Test void testFilterAddressesByName() throws Exception { doTestFilterAddressesByName(); } @Test void testSortAddressesByName() throws Exception { doTestSortAddressesByName(); } @Test void testSortConnectionsBySenders() throws Exception { doTestSortConnectionsBySenders(); } @Test void testSortConnectionsByReceivers() throws Exception { doTestSortConnectionsByReceivers(); } @Test void testFilterConnectionsByEncrypted() throws Exception { doTestFilterConnectionsByEncrypted(); } @Test void testFilterConnectionsByUser() throws Exception { doTestFilterConnectionsByUser(); } @Test void testFilterConnectionsByHostname() throws Exception { doTestFilterConnectionsByHostname(); } @Test void testSortConnectionsByHostname() throws Exception { doTestSortConnectionsByHostname(); } @Test void testFilterConnectionsByContainerId() throws Exception { doTestFilterConnectionsByContainerId(); } @Test void testSortConnectionsByContainerId() throws Exception { doTestSortConnectionsByContainerId(); } @Test void testMessagesMetrics() throws Exception { doTestMessagesMetrics(); } @Test void testClientsMetrics() throws Exception { doTestClientsMetrics(); } @Test void testCannotCreateAddresses() throws Exception { doTestCannotCreateAddresses(); } @Test void testCannotDeleteAddresses() throws Exception { doTestCannotDeleteAddresses(); } @Test void testViewAddresses() throws Exception { doTestViewAddresses(); } @Test void testViewConnections() throws Exception { doTestViewConnections(); } @Test void testViewAddressesWildcards() throws Exception { doTestViewAddressesWildcards(); } @Test() void testCannotOpenConsolePage() { assertThrows(IllegalAccessException.class, () -> doTestCanOpenConsolePage(new KeycloakCredentials("pepa", "pepaPa555"))); } @Test void testCanOpenConsolePage() throws Exception { doTestCanOpenConsolePage(defaultCredentials); } @Override public boolean skipDummyAddress() { return true; } }
92450ccca69b43c55f2e9abaca09efb7bb7880da
4,442
java
Java
src/main/java/nc/multiblock/fission/tile/IFissionComponent.java
ThizThizzyDizzy/NuclearCraft
ce40952542e422a6e509dc756aa0415766732655
[ "MIT" ]
180
2016-01-13T07:49:52.000Z
2021-10-01T03:47:59.000Z
src/main/java/nc/multiblock/fission/tile/IFissionComponent.java
ThizThizzyDizzy/NuclearCraft
ce40952542e422a6e509dc756aa0415766732655
[ "MIT" ]
742
2016-01-18T04:42:34.000Z
2021-09-26T16:35:50.000Z
src/main/java/nc/multiblock/fission/tile/IFissionComponent.java
ThizThizzyDizzy/NuclearCraft
ce40952542e422a6e509dc756aa0415766732655
[ "MIT" ]
150
2016-01-18T04:18:35.000Z
2021-09-01T18:15:06.000Z
33.398496
226
0.758217
1,003,231
package nc.multiblock.fission.tile; import java.util.Iterator; import javax.annotation.Nullable; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; import nc.multiblock.fission.FissionCluster; import nc.multiblock.fission.tile.IFissionFuelComponent.*; import nc.util.Lang; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentString; import net.minecraft.world.World; public interface IFissionComponent extends IFissionPart { public @Nullable FissionCluster getCluster(); public default FissionCluster newCluster(int id) { return new FissionCluster(getMultiblock(), id); } public default void setCluster(@Nullable FissionCluster cluster) { if (cluster == null && getCluster() != null) { // getCluster().getComponentMap().remove(pos.toLong()); } else if (cluster != null) { cluster.getComponentMap().put(getTilePos().toLong(), this); } setClusterInternal(cluster); } public void setClusterInternal(@Nullable FissionCluster cluster); public default boolean isClusterSearched() { return getCluster() != null; } /** Unlike {@link IFissionComponent#isFunctional}, includes checking logic during clusterSearch if necessary! */ public boolean isValidHeatConductor(final Long2ObjectMap<IFissionComponent> componentFailCache, final Long2ObjectMap<IFissionComponent> assumedValidCache); public boolean isFunctional(); public void resetStats(); public boolean isClusterRoot(); public default void clusterSearch(Integer id, final Object2IntMap<IFissionComponent> clusterSearchCache, final Long2ObjectMap<IFissionComponent> componentFailCache, final Long2ObjectMap<IFissionComponent> assumedValidCache) { if (!isValidHeatConductor(componentFailCache, assumedValidCache)) { return; } if (isClusterSearched()) { if (id != null) { getMultiblock().mergeClusters(id, getCluster()); } return; } if (id == null) { id = getMultiblock().clusterCount++; } FissionCluster cluster = getMultiblock().getClusterMap().get(id.intValue()); if (cluster == null) { cluster = newCluster(id); getMultiblock().getClusterMap().put(id.intValue(), cluster); } setCluster(cluster); for (EnumFacing dir : EnumFacing.VALUES) { BlockPos offPos = getTilePos().offset(dir); if (!getCluster().connectedToWall) { TileEntity part = getTileWorld().getTileEntity(offPos); if (part instanceof TileFissionPart && ((TileFissionPart) part).getPartPositionType().isGoodForWall()) { getCluster().connectedToWall = true; continue; } } IFissionComponent component = getMultiblock().getPartMap(IFissionComponent.class).get(offPos.toLong()); if (component != null) { clusterSearchCache.put(component, id); } } } public long getHeatStored(); public void setHeatStored(long heat); public void onClusterMeltdown(Iterator<IFissionComponent> componentIterator); public boolean isNullifyingSources(EnumFacing side); // Moderator Line public default ModeratorBlockInfo getModeratorBlockInfo(EnumFacing dir, boolean validActiveModeratorPos) { return null; } /** The moderator line does not necessarily have to be complete! */ public default void onAddedToModeratorCache(ModeratorBlockInfo thisInfo) {} /** Called if and only if the moderator line from the fuel component searching in the dir direction is complete! */ public default void onModeratorLineComplete(ModeratorLine line, ModeratorBlockInfo thisInfo, EnumFacing dir) {} /** Called during cluster searches! */ public default boolean isActiveModerator() { return false; } // IMultitoolLogic @Override public default boolean onUseMultitool(ItemStack multitoolStack, EntityPlayer player, World world, EnumFacing facing, float hitX, float hitY, float hitZ) { if (player.isSneaking()) { NBTTagCompound nbt = multitoolStack.getTagCompound(); nbt.setLong("componentPos", getTilePos().toLong()); player.sendMessage(new TextComponentString(Lang.localise("info.nuclearcraft.multitool.copy_component_info"))); return true; } else { } return IFissionPart.super.onUseMultitool(multitoolStack, player, world, facing, hitX, hitY, hitZ); } }
92450cfb42bc76a85d0cdc99e2799de297097013
1,095
java
Java
src/main/java/by/hunar/graphql/converter/OrderStateConverter.java
hunarepam/graphql
ac8ba8ba8163bbba4bbf226555ed34978d8c2fbf
[ "Apache-2.0" ]
null
null
null
src/main/java/by/hunar/graphql/converter/OrderStateConverter.java
hunarepam/graphql
ac8ba8ba8163bbba4bbf226555ed34978d8c2fbf
[ "Apache-2.0" ]
null
null
null
src/main/java/by/hunar/graphql/converter/OrderStateConverter.java
hunarepam/graphql
ac8ba8ba8163bbba4bbf226555ed34978d8c2fbf
[ "Apache-2.0" ]
null
null
null
36.5
89
0.721461
1,003,232
package by.hunar.graphql.converter; import by.hunar.graphql.entity.OrderStateEntity; import by.hunar.graphql.model.OrderState; import by.hunar.graphql.repository.OrderStateRepository; import java.util.Optional; import org.springframework.stereotype.Component; @Component public record OrderStateConverter(OrderStateRepository repository) { public OrderState convertToDto(OrderStateEntity entity) { return new OrderState(entity.getId(), entity.getName()); } public OrderStateEntity convertToEntity(OrderState orderState) { Optional<OrderStateEntity> entityOptional = repository.findById(orderState.id()); if(entityOptional.isPresent()) { OrderStateEntity orderStateEntity = entityOptional.get(); orderStateEntity.setName(orderState.name()); return orderStateEntity; } else { OrderStateEntity orderStateEntity = new OrderStateEntity(); orderStateEntity.setId(orderState.id()); orderStateEntity.setName(orderState.name()); return orderStateEntity; } } }
92450dd69e4f1dcec5a5f55ad3386f0fc48295be
1,491
java
Java
mantis-tests/src/test/java/ru/andrew/mantis/applicationManager/MailHelper.java
AndrewFlu/JavaPFT_Mac
eaccee9cf3916206870abeda85319c9bbd8d7c20
[ "Apache-2.0" ]
null
null
null
mantis-tests/src/test/java/ru/andrew/mantis/applicationManager/MailHelper.java
AndrewFlu/JavaPFT_Mac
eaccee9cf3916206870abeda85319c9bbd8d7c20
[ "Apache-2.0" ]
null
null
null
mantis-tests/src/test/java/ru/andrew/mantis/applicationManager/MailHelper.java
AndrewFlu/JavaPFT_Mac
eaccee9cf3916206870abeda85319c9bbd8d7c20
[ "Apache-2.0" ]
null
null
null
24.442623
102
0.672703
1,003,233
package ru.andrew.mantis.applicationManager; import org.subethamail.wiser.Wiser; import org.subethamail.wiser.WiserMessage; import ru.andrew.mantis.model.MailMessage; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import java.io.IOException; import java.util.List; import java.util.stream.Collectors; public class MailHelper { private final Wiser wiser; private ApplicationManager app; public MailHelper(ApplicationManager app) { this.app = app; wiser = new Wiser(); } public List<MailMessage> wailForMail (int count, long timeout){ long now = System.currentTimeMillis(); while (System.currentTimeMillis() <= now + timeout){ if (wiser.getMessages().size() >= count){ return wiser.getMessages().stream().map((m) -> toModelMail(m)).collect(Collectors.toList()); } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } throw new Error("No mail :("); } private MailMessage toModelMail(WiserMessage m) { try { MimeMessage message = m.getMimeMessage(); return new MailMessage(message.getAllRecipients()[0].toString(), (String) message.getContent()); } catch (MessagingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; } public void start(){ wiser.setPort(1025); wiser.start(); } public void stop(){ wiser.stop(); } }
92450e46f07da47b169b839364a5a294b3581fbc
6,125
java
Java
RSX/app/src/main/java/com/rockola/rsx/FotoActivity.java
Eduardox18/PF_Android_DH
b2dea9ddf05964f3148d4451195575c23cc5381b
[ "MIT" ]
null
null
null
RSX/app/src/main/java/com/rockola/rsx/FotoActivity.java
Eduardox18/PF_Android_DH
b2dea9ddf05964f3148d4451195575c23cc5381b
[ "MIT" ]
null
null
null
RSX/app/src/main/java/com/rockola/rsx/FotoActivity.java
Eduardox18/PF_Android_DH
b2dea9ddf05964f3148d4451195575c23cc5381b
[ "MIT" ]
null
null
null
33.839779
83
0.631673
1,003,234
package com.rockola.rsx; import android.Manifest; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Environment; import android.provider.MediaStore; import android.support.v4.app.ActivityCompat; import android.support.v4.content.FileProvider; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.Toast; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import com.google.gson.Gson; import com.rockola.rsx.ws.HttpUtils; import com.rockola.rsx.ws.Response; import com.rockola.rsx.ws.pojos.Mensaje; public class FotoActivity extends AppCompatActivity { public static final int REQUEST_CAPTURE = 1; public static final int PICK_IMAGE = 100; private ImageView img_foto; private Button button_tomar; private Button button_enviar; private ProgressDialog espera; private Bitmap foto; private Uri photoURI; private Response resws; private String idReporte; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_foto); img_foto = (ImageView) findViewById(R.id.img_foto); button_enviar = (Button) findViewById(R.id.botton_enviar); button_enviar.setEnabled(false); if (!validarCamara()) { Toast.makeText(this, "El dispositivo no cuenta con cámara", Toast.LENGTH_LONG).show(); } validarPermisosAlmacenamiento(); parametrosIntent(); } private void parametrosIntent() { Intent intent = getIntent(); idReporte = intent.getStringExtra("id_reporte"); } private void validarPermisosAlmacenamiento() { if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { Toast.makeText(this, "Sin acceso al almacenamiento interno", Toast.LENGTH_LONG).show(); ActivityCompat.requestPermissions(this, new String[]{ Manifest.permission.WRITE_EXTERNAL_STORAGE }, 1); } } private boolean validarCamara(){ return getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA_ANY); } public void tomarFoto(View view) { button_enviar.setEnabled(false); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File tmp = null; try { tmp = crearArchivoTemporal(); } catch (IOException ex) { ex.printStackTrace(); } if (tmp != null) { photoURI = FileProvider.getUriForFile(this, "com.rockola.rsx", tmp); intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI); startActivityForResult(intent, REQUEST_CAPTURE); } } private File crearArchivoTemporal() throws IOException { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss"); String nombre = sdf.format(new Date()) + ".jpg"; File path = getExternalFilesDir( Environment.DIRECTORY_PICTURES + "/tmps"); File archivo = File.createTempFile(nombre, ".jpg",path); return archivo; } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { //--------DESDE CAMARA----------// if (requestCode == REQUEST_CAPTURE) { if (resultCode == RESULT_OK) { img_foto.setImageURI(this.photoURI); img_foto.setRotation(90); foto = ((BitmapDrawable) img_foto.getDrawable()).getBitmap(); button_enviar.setEnabled(true); } } } public void subirAServidor(View view){ espera = new ProgressDialog(this); espera.setTitle("Subiendo foto"); espera.setMessage("Espera por favor"); espera.setCancelable(false); espera.show(); WSPOSTFotosTask task = new WSPOSTFotosTask(); task.execute(idReporte, this.foto); } class WSPOSTFotosTask extends AsyncTask<Object, String, String> { @Override protected String doInBackground(Object ... params) { resws = HttpUtils.subirFoto((String)params[0],(Bitmap)params[1]); return null; } @Override protected void onPostExecute(String result) { super.onPostExecute(result); resultadoFoto(); } } private void resultadoFoto() { espera.dismiss(); if (resws != null && !resws.isError()) { Mensaje mensaje = new Gson().fromJson(resws.getResult(),Mensaje.class); if (mensaje.getStatusMensaje() == 700) { mostrarAlertDialog("Éxito", mensaje.getMensaje()); } else if (mensaje.getStatusMensaje() == 1) { mostrarAlertDialog("Error", mensaje.getMensaje()); } } else { mostrarAlertDialog("Error", resws.getResult()); } } private void mostrarAlertDialog(String titulo, String mensaje){ AlertDialog dialog = new AlertDialog.Builder(FotoActivity.this).create(); dialog.setMessage(mensaje); dialog.setTitle(titulo); dialog.setButton(AlertDialog.BUTTON_POSITIVE, "Aceptar", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int which) { dialog.dismiss(); finish(); } }); dialog.show(); } }
92450e80065b3acf458f53cbdb0693cb3323d8f3
2,632
java
Java
src/main/java/za/co/kmotsepe/tasuku/checkstyle/CheckStyleListener.java
kmotsepe/tasuku
134a8a99bd04d6b337d663a103a595084013137f
[ "MIT" ]
null
null
null
src/main/java/za/co/kmotsepe/tasuku/checkstyle/CheckStyleListener.java
kmotsepe/tasuku
134a8a99bd04d6b337d663a103a595084013137f
[ "MIT" ]
2
2017-07-21T08:40:28.000Z
2019-05-11T19:38:26.000Z
src/main/java/za/co/kmotsepe/tasuku/checkstyle/CheckStyleListener.java
kmotsepe/tasuku
134a8a99bd04d6b337d663a103a595084013137f
[ "MIT" ]
null
null
null
24.146789
84
0.631079
1,003,235
/** * Checkstyle related implementations */ package za.co.kmotsepe.tasuku.checkstyle; import com.google.common.eventbus.EventBus; import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.AuditListener; import lombok.Getter; import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.log4j.Logger; import za.co.kmotsepe.tasuku.events.impl.CheckStyleErrorEventListener; /** * * @author Kingsley Motsepe */ public class CheckStyleListener implements AuditListener { /** * Guava EventBus */ @Getter @Setter private EventBus eventBus; /** * Guava EventBus Listener */ @Getter @Setter private CheckStyleErrorEventListener checkStyleErrorEventListener; /** * Application logger */ private static final Logger LOGGER = Logger.getLogger(CheckStyleListener.class); /** * * @param ae AuditEvent */ @Override public final void auditStarted(final AuditEvent ae) { LOGGER.info("Checkstyle audit started"); } /** * * @param ae AuditEvent */ @Override public final void auditFinished(final AuditEvent ae) { LOGGER.info("Checkstyle audit finished"); } /** * * @param ae AuditEvent */ @Override public final void fileStarted(final AuditEvent ae) { StringBuilder message = new StringBuilder(); LOGGER.info(message.append("File started=>") .append(ae.getFileName()).toString()); } /** * * @param ae AuditEvent */ @Override public final void fileFinished(final AuditEvent ae) { LOGGER.info("Checkstyle file finished"); } /** * * @param ae AuditEvent */ @Override public final void addError(final AuditEvent ae) { StringBuilder message = new StringBuilder(); LOGGER.info(message.append("File=>") .append(FilenameUtils.getName(ae.getFileName())) .append("\nLine number=>").append(ae.getLine()) .append("\nSeverity=>") .append(ae.getSeverityLevel().getName())); eventBus = new EventBus(); checkStyleErrorEventListener = new CheckStyleErrorEventListener(); eventBus.register(checkStyleErrorEventListener); eventBus.post(ae); } /** * * @param ae Checkstyle audit event * @param thrwbl exception */ @Override public final void addException(final AuditEvent ae, final Throwable thrwbl) { LOGGER.error(thrwbl.getMessage()); } }
92450f058b5e450dc006f3088304e4681a9b95f5
594
java
Java
pnet-data-api-java/src/main/java/pnet/data/api/util/RestrictControllingArea.java
porscheinformatik/pnet-data-api
5a38384622bbd6ada3460d496ed558848c6430bb
[ "Apache-2.0" ]
null
null
null
pnet-data-api-java/src/main/java/pnet/data/api/util/RestrictControllingArea.java
porscheinformatik/pnet-data-api
5a38384622bbd6ada3460d496ed558848c6430bb
[ "Apache-2.0" ]
8
2019-10-16T06:15:35.000Z
2020-07-29T10:55:58.000Z
pnet-data-api-java/src/main/java/pnet/data/api/util/RestrictControllingArea.java
porscheinformatik/pnet-data-api
5a38384622bbd6ada3460d496ed558848c6430bb
[ "Apache-2.0" ]
1
2021-11-07T05:55:50.000Z
2021-11-07T05:55:50.000Z
23.76
94
0.722222
1,003,236
package pnet.data.api.util; import java.util.Collection; /** * Restricts controlling areas. * * @author ham * @param <SELF> the type of the filter for chaining */ public interface RestrictControllingArea<SELF extends Restrict<SELF>> extends Restrict<SELF> { default SELF controllingArea(String... controllingAreas) { return restrict("controllingArea", (Object[]) controllingAreas); } default SELF controllingAreas(Collection<String> controllingAreas) { return controllingArea(controllingAreas.toArray(new String[controllingAreas.size()])); } }
92450f1d2cbf8b7a658d50e84b8276db83b101a5
4,572
java
Java
telegram-api/src/main/java/tech/teslex/telegroo/telegram/api/types/update/Update.java
TesLex/telegroo
9310c0f3369abdbe8da01e38b2d5305055620167
[ "Apache-2.0" ]
1
2019-01-31T21:45:30.000Z
2019-01-31T21:45:30.000Z
telegram-api/src/main/java/tech/teslex/telegroo/telegram/api/types/update/Update.java
TesLex/telegroo
9310c0f3369abdbe8da01e38b2d5305055620167
[ "Apache-2.0" ]
null
null
null
telegram-api/src/main/java/tech/teslex/telegroo/telegram/api/types/update/Update.java
TesLex/telegroo
9310c0f3369abdbe8da01e38b2d5305055620167
[ "Apache-2.0" ]
null
null
null
39.413793
430
0.755906
1,003,237
package tech.teslex.telegroo.telegram.api.types.update; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import tech.teslex.telegroo.telegram.api.types.CallbackQuery; import tech.teslex.telegroo.telegram.api.types.Message; import tech.teslex.telegroo.telegram.api.types.Poll; import tech.teslex.telegroo.telegram.api.types.inline.ChosenInlineResult; import tech.teslex.telegroo.telegram.api.types.inline.InlineQuery; import tech.teslex.telegroo.telegram.api.types.payments.PreCheckoutQuery; import tech.teslex.telegroo.telegram.api.types.payments.ShippingQuery; import tech.teslex.telegroo.telegram.enums.UpdateType; @Data @JsonInclude(JsonInclude.Include.NON_NULL) public class Update { /** * The update‘s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. */ @JsonProperty(value = "update_id") private Long updateId = 0L; /** * Optional. New incoming message of any kind — text, photo, sticker, etc. */ @JsonProperty(required = false) private Message message; /** * Optional. New version of a message that is known to the bot and was edited */ @JsonProperty(value = "edited_message", required = false) private Message editedMessage; /** * Optional. New incoming channel post of any kind — text, photo, sticker, etc. */ @JsonProperty(value = "channel_post", required = false) private Message channelPost; /** * Optional. New version of a channel post that is known to the bot and was edited */ @JsonProperty(value = "edited_channel_post", required = false) private Message editedChannelPost; /** * Optional. New incoming shipping query. Only for invoices with flexible price */ @JsonProperty(value = "shipping_query", required = false) private ShippingQuery shippingQuery; /** * Optional. New incoming pre-checkout query. Contains full information about checkout */ @JsonProperty(value = "pre_checkout_query", required = false) private PreCheckoutQuery preCheckoutQuery; /** * Optional. New incoming callback query */ @JsonProperty(value = "callback_query", required = false) private CallbackQuery callbackQuery; /** * Optional. New incoming inline query */ @JsonProperty(value = "inline_query", required = false) private InlineQuery inlineQuery; /** * Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. */ @JsonProperty(value = "chosen_inline_result", required = false) private ChosenInlineResult chosenInlineResult; /** * Optional. New poll state. Bots receive only updates about polls, which are sent or stopped by the bot */ @JsonProperty(required = false) private Poll poll; /** * Not a Telegram API part. Just an utility. * * Returns update type; * * @see UpdateType * * @return update type */ @JsonIgnore public UpdateType getUpdateType() { if (message != null) return UpdateType.MESSAGE; else if (editedMessage != null) return UpdateType.EDITED_MESSAGE; else if (channelPost != null) return UpdateType.CHANNEL_POST; else if (editedChannelPost != null) return UpdateType.EDITED_CHANNEL_POST; else if (shippingQuery != null) return UpdateType.SHIPPING_QUERY; else if (preCheckoutQuery != null) return UpdateType.PRE_CHECKOUT_QUERY; else if (callbackQuery != null) return UpdateType.CALLBACK_QUERY; else if (inlineQuery != null) return UpdateType.INLINE_QUERY; else if (chosenInlineResult != null) return UpdateType.CHOSEN_INLINE_QUERY; else if (poll != null) return UpdateType.POLL; else return UpdateType.UPDATE; } /** * Not a Telegram API part. Just an utility. * * Returns chat id if specified. * * @return id of the chat */ @JsonIgnore public Long getChatId() { if (message != null) return message.getChat().getId(); else if (editedMessage != null) return editedMessage.getChat().getId(); else if (channelPost != null) return channelPost.getChat().getId(); else if (editedChannelPost != null) return editedChannelPost.getChat().getId(); else return -1L; } }
92450f8192ca6ad8875073a554af6ea7a8f41c86
5,021
java
Java
src/PlayerWarpGUI/Commands/SubCommands/ListCommand.java
theLastHero/special-octo-palm-tree
8c8538ba0849328513fcf567e74ffa0968312e88
[ "MIT" ]
null
null
null
src/PlayerWarpGUI/Commands/SubCommands/ListCommand.java
theLastHero/special-octo-palm-tree
8c8538ba0849328513fcf567e74ffa0968312e88
[ "MIT" ]
null
null
null
src/PlayerWarpGUI/Commands/SubCommands/ListCommand.java
theLastHero/special-octo-palm-tree
8c8538ba0849328513fcf567e74ffa0968312e88
[ "MIT" ]
null
null
null
41.841667
161
0.71898
1,003,238
package PlayerWarpGUI.Commands.SubCommands; import java.util.ArrayList; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import PlayerWarpGUI.Objects.PlayerWarpObject; import PlayerWarpGUI.Utils.StringUtils; import PlayerWarpGUI.Utils.Warp.ObjectUtils; import PlayerWarpGUI.locale.LocaleLoader; /** * List Command: <br> * Show player a list of their warp they have set.<br> * If warp name is added then show details of that specific warp. * * @author Judgetread * @version 1.0 */ public class ListCommand implements CommandExecutor{ /* (non-Javadoc) * @see org.bukkit.command.CommandExecutor#onCommand(org.bukkit.command.CommandSender, org.bukkit.command.Command, java.lang.String, java.lang.String[]) */ @Override public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) { final Player player = (Player) sender; if ((args.length > 1)) { Bukkit.getConsoleSender().sendMessage(LocaleLoader.getString("COMMAND_USE_LIST")); return false; } final ArrayList<PlayerWarpObject> playerWarpObjects = ObjectUtils.getInstance().getPlayerWarpObjects(player.getUniqueId()); if (playerWarpObjects.size() <= 0) { player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARPS_TITLE")); player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_NONE_TEXT")); return true; } if (args.length == 0) { player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARPS_TITLE")); for (int i = 0; i < playerWarpObjects.size(); i++) { final String warpText = playerWarpObjects.get(i).getWarpName(); final Location warpLocation = StringUtils.getInstance() .str2loc(playerWarpObjects.get(i).getWarpLocation()); final String warpWorld = warpLocation.getWorld().getName().toString(); final String warpXpos = String.valueOf(warpLocation.getX()).split("\\.")[0]; final String warpYpos = String.valueOf(warpLocation.getY()).split("\\.")[0]; final String warpZpos = String.valueOf(warpLocation.getZ()).split("\\.")[0]; if (!(i >= playerWarpObjects.size())) { player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP", new Object[] { String.valueOf(i + 1), warpText, warpWorld, warpXpos, warpYpos, warpZpos })); } } } if (args.length == 1) { final PlayerWarpObject pwo = ObjectUtils.getInstance().getPlayerWarpObject(player.getUniqueId(), args[0]); if (pwo == null) { player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_UPDATE_DOESNT_EXSISTS_TEXT", args[0])); return false; } final String warpText = pwo.getWarpName(); final Location warpLocation = StringUtils.getInstance().str2loc(pwo.getWarpLocation()); final String warpWorld = warpLocation.getWorld().getName().toString(); final String warpXpos = String.valueOf(warpLocation.getX()).split("\\.")[0]; final String warpYpos = String.valueOf(warpLocation.getY()).split("\\.")[0]; final String warpZpos = String.valueOf(warpLocation.getZ()).split("\\.")[0]; final String warpTitle = pwo.getTitle(); final String warpIcon = pwo.getIcon(); final ArrayList<String> warpLore = pwo.getLoreList(); final ArrayList<String> warpBan = pwo.getBanList(); player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARPS_DETAILS_TITLE", warpText)); // title player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP_TITLE", warpTitle)); // Location player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP_LOCATION", warpWorld, warpXpos, warpYpos, warpZpos)); // ICON player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP_ICON", warpIcon)); // LOREMAIN player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP_LORE_MAIN")); // LORE LOOP int i = 0; for (final String lore : warpLore) { i++; if (lore.length() > 0) { player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP_LORE", lore, i)); } } // BAN MAIN player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP_BAN_MAIN")); // BAN LOOP for (final String ban : warpBan) { if (ban.length() > 0) { player.sendMessage(LocaleLoader.getString("MESSAGE_PREFIX") + LocaleLoader.getString("COMMAND_LIST_WARP_BAN", ban)); } } } return true; } }
9245109b90d4ca6562177c008e41f012f170820d
119
java
Java
template/gui/swing/Action.java
plum-umd/pasket
37ba5b5f503a485c1057caaa6b57061898f05955
[ "MIT" ]
18
2016-05-25T10:51:51.000Z
2020-11-01T21:24:29.000Z
template/gui/swing/Action.java
plum-umd/pasket
37ba5b5f503a485c1057caaa6b57061898f05955
[ "MIT" ]
1
2016-06-30T03:25:01.000Z
2016-08-21T09:19:07.000Z
template/gui/swing/Action.java
plum-umd/pasket
37ba5b5f503a485c1057caaa6b57061898f05955
[ "MIT" ]
7
2016-12-06T16:06:20.000Z
2020-04-28T10:30:11.000Z
19.833333
48
0.806723
1,003,239
package javax.swing; public interface Action extends ActionListener { public void actionPerformed(ActionEvent e); }
9245119890cf8d788ecbd812a7421649aeca1473
3,823
java
Java
jsoar-core/src/main/java/org/jsoar/kernel/memory/WorkingMemoryPatternReader.java
soartech/jsoar
7c32c192b1b47f8cb975ee5f0397b48ac53088d3
[ "BSD-3-Clause" ]
33
2015-04-05T09:26:05.000Z
2021-12-05T04:18:28.000Z
jsoar-core/src/main/java/org/jsoar/kernel/memory/WorkingMemoryPatternReader.java
soartech/jsoar
7c32c192b1b47f8cb975ee5f0397b48ac53088d3
[ "BSD-3-Clause" ]
73
2015-04-17T07:11:18.000Z
2021-07-06T06:00:06.000Z
jsoar-core/src/main/java/org/jsoar/kernel/memory/WorkingMemoryPatternReader.java
soartech/jsoar
7c32c192b1b47f8cb975ee5f0397b48ac53088d3
[ "BSD-3-Clause" ]
19
2015-05-28T21:39:54.000Z
2022-03-03T07:59:30.000Z
35.073394
171
0.607115
1,003,240
package org.jsoar.kernel.memory; import java.io.IOException; import java.io.StringReader; import org.jsoar.kernel.Agent; import org.jsoar.kernel.parser.original.Lexeme; import org.jsoar.kernel.parser.original.LexemeType; import org.jsoar.kernel.parser.original.Lexer; import org.jsoar.kernel.symbols.Identifier; import org.jsoar.kernel.symbols.SymbolFactory; import org.jsoar.kernel.tracing.Printer; import com.google.common.base.Predicate; public class WorkingMemoryPatternReader { public static Predicate<Wme> getPredicate(Agent context, String pattern) throws IllegalArgumentException { final Printer printer = context.getPrinter(); final StringReader reader = new StringReader(pattern); final SymbolFactory syms = context.getSymbols(); Lexer lex = null; try { lex = new Lexer(printer, reader); lex.setAllowIds(true); lex.getNextLexeme(); } catch(IOException e) { e.printStackTrace(); // probably should throw a new exception (e.g., PatternReaderException) } Lexeme idlexeme = lex.getCurrentLexeme(); Identifier id = null; // assume null (any value), and override as necessary if(idlexeme.type == LexemeType.IDENTIFIER) { id = syms.findIdentifier(idlexeme.id_letter, idlexeme.id_number); if(id == null) { throw new IllegalArgumentException("No such id " + idlexeme.id_letter + idlexeme.id_number); } } else if(!idlexeme.toString().equals("*")) { throw new IllegalArgumentException("First entry must be identifier or '*', got '" + idlexeme + "'"); } try { lex.getNextLexeme(); } catch(IOException e) { e.printStackTrace(); // probably should throw a new exception (e.g., PatternReaderException) } Lexeme attrlexeme = lex.getCurrentLexeme(); if(attrlexeme.type == LexemeType.UP_ARROW) // skip up arrow on attribute if it's there. { try { lex.getNextLexeme(); attrlexeme = lex.getCurrentLexeme(); } catch(IOException e) { e.printStackTrace(); // probably should throw a new exception (e.g., PatternReaderException) } } Object attr = getPatternValue(syms, attrlexeme); try { lex.getNextLexeme(); } catch(IOException e) { e.printStackTrace(); // probably should throw a new exception (e.g., PatternReaderException) } Lexeme valuelexeme = lex.getCurrentLexeme(); Object value = getPatternValue(syms, valuelexeme); // TODO: acceptable test return Wmes.newMatcher(syms, id, attr, value, -1); } private static Object getPatternValue(SymbolFactory syms, Lexeme l) throws IllegalArgumentException { Object value = null; // assume null (any value), and override as necessary switch(l.type) { case IDENTIFIER: value = syms.findIdentifier(l.id_letter, l.id_number); if(value == null) { throw new IllegalArgumentException("No such id " + l.id_letter + l.id_number); } break; case SYM_CONSTANT: if(!l.toString().equals("*")) // * means any value, which is null { value = l.toString(); } break; case FLOAT: value = l.float_val; break; case INTEGER: value = l.int_val; break; default: throw new IllegalArgumentException("Missing pattern element (must be '*', an attribute, or a value). Maybe you forgot to wrap your pattern in double quotes?"); } return value; } }
924511cd5dd96367b80d63488f2eca326cdb6e3c
6,542
java
Java
src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java
D-Cysteine/bartworks
9b9af573f7a67c4754b88af40da9a1f2ed21af86
[ "MIT" ]
14
2019-01-12T19:57:37.000Z
2021-02-24T11:40:50.000Z
src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java
D-Cysteine/bartworks
9b9af573f7a67c4754b88af40da9a1f2ed21af86
[ "MIT" ]
67
2019-01-10T09:49:03.000Z
2021-04-02T22:28:50.000Z
src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java
D-Cysteine/bartworks
9b9af573f7a67c4754b88af40da9a1f2ed21af86
[ "MIT" ]
30
2018-12-30T04:36:50.000Z
2022-02-04T06:52:54.000Z
55.91453
233
0.737389
1,003,241
/* * Copyright (c) 2018-2020 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import ic2.core.item.ItemFluidCell; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import java.awt.*; import java.util.Arrays; public class FluidLoader { public static IIcon autogenIIcon; public static Fluid ff; public static int renderID; public static Block bioFluidBlock; public static Fluid[] BioLabFluidMaterials; public static ItemStack[] BioLabFluidCells; //OilProcessing chain public static Fluid fulvicAcid,heatedfulvicAcid,Kerogen; public static void run() { FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); short[] rgb = new short[3]; Arrays.fill(rgb, (short) 255); FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb); FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); FluidLoader.heatedfulvicAcid = FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20),720); FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); FluidLoader.BioLabFluidMaterials = new Fluid[]{ new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}), new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}), new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}), new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}), }; FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length]; for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) { FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]); FluidLoader.BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000)); } // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); FluidRegistry.registerFluid(B.getFluid()); GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid"); GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); } } FluidLoader.bioFluidBlock = new BioFluidBlock(); GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock"); GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge"); if (SideReference.Side.Client) { RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance); RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance); } } public static Fluid createAndRegisterFluid(String Name,Color color){ Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); FluidRegistry.registerFluid(f); return f; } public static Fluid createAndRegisterFluid(String Name, Color color, int temperature){ Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); f.setTemperature(temperature); FluidRegistry.registerFluid(f); return f; } }
9245135efdfa12d1e0108833905faaf458479f10
227
java
Java
demos/src/main/java/com/wkk/demo/proxy/dao/IUserDao.java
wkk1994/learn-demos
d3203fe40c5bc9912a3d6a28fb6a670340dcec93
[ "Apache-2.0" ]
null
null
null
demos/src/main/java/com/wkk/demo/proxy/dao/IUserDao.java
wkk1994/learn-demos
d3203fe40c5bc9912a3d6a28fb6a670340dcec93
[ "Apache-2.0" ]
null
null
null
demos/src/main/java/com/wkk/demo/proxy/dao/IUserDao.java
wkk1994/learn-demos
d3203fe40c5bc9912a3d6a28fb6a670340dcec93
[ "Apache-2.0" ]
null
null
null
16.214286
44
0.713656
1,003,242
package com.wkk.demo.proxy.dao; import com.wkk.demo.proxy.entity.UserEntity; /** * @Description * @Author wangkunkun * @Date 2018/06/22 12:13 **/ public interface IUserDao { UserEntity save(UserEntity userEntity); }
9245152eb1fe93cc90c07940f7a2cef846c6a95b
902
java
Java
src/main/java/de/dm/intellij/liferay/module/LiferayModuleComponentStateWrapper.java
dmarks2/liferay-plugin-intellij
674a8ae98547b99db2ff95badf3af52c30c10480
[ "BSD-3-Clause", "MIT" ]
13
2018-02-04T10:53:45.000Z
2022-01-28T14:25:02.000Z
src/main/java/de/dm/intellij/liferay/module/LiferayModuleComponentStateWrapper.java
dmarks2/liferay-plugin-intellij
674a8ae98547b99db2ff95badf3af52c30c10480
[ "BSD-3-Clause", "MIT" ]
5
2017-08-31T08:26:57.000Z
2022-02-02T08:01:22.000Z
src/main/java/de/dm/intellij/liferay/module/LiferayModuleComponentStateWrapper.java
dmarks2/liferay-plugin-intellij
674a8ae98547b99db2ff95badf3af52c30c10480
[ "BSD-3-Clause", "MIT" ]
7
2017-11-27T21:10:45.000Z
2022-03-17T11:53:30.000Z
23.736842
54
0.700665
1,003,243
package de.dm.intellij.liferay.module; import com.intellij.util.xmlb.annotations.Attribute; import java.util.HashMap; import java.util.Map; public class LiferayModuleComponentStateWrapper { @Attribute("liferayVersion") public String liferayVersion; public Map<String, String> themeSettings; public String liferayLookAndFeelXml; public String liferayHookXml; public String osgiFragmentHost; public String parentTheme; public String customJspDir; public String resourcesImporterGroupName; public LiferayModuleComponentStateWrapper() { this.liferayVersion = ""; this.liferayLookAndFeelXml = ""; this.liferayHookXml = ""; this.osgiFragmentHost = ""; this.parentTheme = ""; this.customJspDir = ""; this.resourcesImporterGroupName = ""; themeSettings = new HashMap<String, String>(); } }
9245166b6a838af990d568dc5316ad622636c7b2
1,295
java
Java
hypervisor/src/main/java/io/leafage/basic/hypervisor/dto/RoleDTO.java
little3201/abeille-basic
793fd0e27f32ca9e9ce04becc496fd7cbb225b60
[ "Apache-2.0" ]
3
2021-04-27T07:36:20.000Z
2021-09-10T16:49:45.000Z
hypervisor/src/main/java/io/leafage/basic/hypervisor/dto/RoleDTO.java
little3201/leafage-basic
793fd0e27f32ca9e9ce04becc496fd7cbb225b60
[ "Apache-2.0" ]
60
2021-01-28T04:39:37.000Z
2022-03-28T08:15:25.000Z
hypervisor/src/main/java/io/leafage/basic/hypervisor/dto/RoleDTO.java
little3201/abeille-basic
793fd0e27f32ca9e9ce04becc496fd7cbb225b60
[ "Apache-2.0" ]
1
2021-04-19T21:38:14.000Z
2021-04-19T21:38:14.000Z
18.5
70
0.611583
1,003,244
/* * Copyright (c) 2021. Leafage All Right Reserved. */ package io.leafage.basic.hypervisor.dto; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import java.io.Serializable; /** * DTO class for Role * * @author liwenqiang 2020-10-06 22:09 */ public class RoleDTO implements Serializable { private static final long serialVersionUID = 2513250238715183575L; /** * 名称 */ @NotBlank @Size(max = 16) private String name; /** * 上级 */ private String superior; /** * 描述 */ @Size(max = 32) private String description; /** * 修改人 */ private String modifier; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSuperior() { return superior; } public void setSuperior(String superior) { this.superior = superior; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getModifier() { return modifier; } public void setModifier(String modifier) { this.modifier = modifier; } }
9245176df8d949c31158113db3e30359f5d471b7
525
java
Java
src/main/java/com/asodc/patterns/observer/custom/Subject.java
aseriesofdarkcaves/head-first-design-patterns
05bb8666a12b6beca642cd16985e4122342b91b2
[ "MIT" ]
null
null
null
src/main/java/com/asodc/patterns/observer/custom/Subject.java
aseriesofdarkcaves/head-first-design-patterns
05bb8666a12b6beca642cd16985e4122342b91b2
[ "MIT" ]
null
null
null
src/main/java/com/asodc/patterns/observer/custom/Subject.java
aseriesofdarkcaves/head-first-design-patterns
05bb8666a12b6beca642cd16985e4122342b91b2
[ "MIT" ]
null
null
null
35
88
0.740952
1,003,245
package com.asodc.patterns.observer.custom; public interface Subject { // all fields in an interface have to be public static final fields - i.e. constants // all methods in an interface are implicitly public (in java 8 anyway) // it's recommended to omit the public modifier for both fields and methods // even though it could be confused with package-private, but that's java for you void registerObserver(Observer oberver); void removeObserver(Observer observer); void notifyObservers(); }
924518d6257833546116edbb31e9c7ae4bd97ed6
14,102
java
Java
service/src/test/java/entity_service/MovieServiceTest.java
CoderNoOne/JDBI-CRUD-MultiModuleMaven-App
43907ae0786406687637d20d92951307f2641024
[ "MIT" ]
null
null
null
service/src/test/java/entity_service/MovieServiceTest.java
CoderNoOne/JDBI-CRUD-MultiModuleMaven-App
43907ae0786406687637d20d92951307f2641024
[ "MIT" ]
null
null
null
service/src/test/java/entity_service/MovieServiceTest.java
CoderNoOne/JDBI-CRUD-MultiModuleMaven-App
43907ae0786406687637d20d92951307f2641024
[ "MIT" ]
null
null
null
29.440501
118
0.563608
1,003,246
package entity_service; import entity.Movie; import entity_repository.impl.MovieRepository; import exceptions.AppException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoSettings; import org.mockito.quality.Strictness; import java.math.BigDecimal; import java.time.LocalDate; import java.time.Month; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.mockito.BDDMockito.given; import static org.mockito.BDDMockito.then; import static org.mockito.Mockito.times; @DisplayName("Test cases for movie service") @Tag("Services") @MockitoSettings(strictness = Strictness.STRICT_STUBS) @ExtendWith(MockitoExtension.class) class MovieServiceTest { @Mock private MovieRepository movieRepository; @InjectMocks private MovieService movieService; @Test @DisplayName("Get all movies") void test1() { //given List<Movie> expectedResult = List.of( Movie.builder() .id(1) .title("TITLE") .duration(2) .genre("GENRE") .releaseDate(LocalDate.of(2020, 10, 20)) .price(new BigDecimal("30")) .build() ); given(movieRepository.findAll()) .willReturn(expectedResult); //when //then Assertions.assertDoesNotThrow(() -> { List<Movie> actualResult = movieService.getAllMovies(); assertThat(actualResult, is(equalTo(expectedResult))); }); then(movieRepository).should(times(1)).findAll(); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("Get Movie by id : case id is null") void test2() { //given Integer id = null; String expectedExceptionMessage = "Movie id is null"; //when //then AppException actualException = Assertions.assertThrows(AppException.class, () -> movieService.getMovieById(id)); assertThat(actualException.getExceptionMessage(), is(equalTo(expectedExceptionMessage))); then(movieRepository).shouldHaveZeroInteractions(); } @Test @DisplayName("Get movie by id : case id is not null") void test3() { //given Integer id = 2; Optional<Movie> expectedResult = Optional.of(Movie.builder() .id(id) .title("TITLE") .genre("GENRE") .price(new BigDecimal("35")) .duration(2) .releaseDate(LocalDate.of(2020, Month.OCTOBER, 20)) .build()); given(movieRepository.findById(id)) .willReturn(expectedResult); //when //then Assertions.assertDoesNotThrow(() -> { Optional<Movie> actualResult = movieService.getMovieById(id); assertThat(actualResult, is(equalTo(expectedResult))); }); then(movieRepository).should(times(1)).findById(id); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("Delete movie by id : case id is null") void test4() { //given Integer id = null; String expectedExceptionMessage = "Movie id is null"; //when //then AppException actualException = Assertions.assertThrows(AppException.class, () -> movieService.deleteMovie(id)); assertThat(actualException.getExceptionMessage(), is(equalTo(expectedExceptionMessage))); then(movieRepository).shouldHaveZeroInteractions(); } @Test @DisplayName("Delete movie by id : case id is not null") void test5() { //given Integer id = 6; //when //then Assertions.assertDoesNotThrow(() -> movieService.deleteMovie(id)); then(movieRepository).should(times(1)).delete(id); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("Add Movie : case movie is null") void test6() { //given Movie movie = null; String expectedExceptionMessage = "Movie is null"; //when //then AppException actualException = Assertions.assertThrows(AppException.class, () -> movieService.addMovie(movie)); assertThat(actualException.getExceptionMessage(), is(equalTo(expectedExceptionMessage))); then(movieRepository).shouldHaveZeroInteractions(); } @Test @DisplayName("Add movie : case movie is not null: movie is not valid") void test7() { //given Movie movie = Movie.builder() .id(1) .genre("genre") .title("title") .build(); //then //when Assertions.assertDoesNotThrow(() -> { boolean actualResult = movieService.addMovie(movie); assertThat(actualResult, is(equalTo(false))); }); then(movieRepository).shouldHaveZeroInteractions(); } @Test @DisplayName("Add movie : case movie is not null and movie is valid") void test8() { //given Movie movie = Movie.builder() .id(1) .title("TITLE") .duration(2) .releaseDate(LocalDate.now().plusMonths(2L)) .price(new BigDecimal("30")) .genre("GENRE") .build(); //when //then Assertions.assertDoesNotThrow(() -> { boolean actualResult = movieService.addMovie(movie); assertThat(actualResult, is(equalTo(true))); }); then(movieRepository).should(times(1)).add(movie); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("Update movie : case movie is null") void test9() { //given Movie movie = null; String expectedExceptionMessage = "Movie is null"; //when //then AppException actualException = Assertions.assertThrows(AppException.class, () -> movieService.updateMovie(movie)); assertThat(actualException.getExceptionMessage(), is(equalTo(expectedExceptionMessage))); then(movieRepository).shouldHaveZeroInteractions(); } @Test @DisplayName("Update movie : case movie is not null: movie is not valid") void test10() { //given Movie movie = Movie.builder() .genre("genre") .build(); //when //then Assertions.assertDoesNotThrow(() -> { boolean actualResult = movieService.updateMovie(movie); assertThat(actualResult, is(equalTo(false))); }); then(movieRepository).shouldHaveZeroInteractions(); } @Test @DisplayName("Update movie : case movie is not null : movie is valid") void test11() { //given Movie movie = Movie.builder() .genre("NEW GENRE") .build(); //when //then Assertions.assertDoesNotThrow(() -> { boolean actualResult = movieService.updateMovie(movie); assertThat(actualResult, is(equalTo(true))); }); then(movieRepository).should(times(1)).update(movie); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("get Average movie duration") void test12() { //given List<Movie> movieList = getMovieList(); given(movieRepository.findAll()) .willReturn(movieList); Map<String, Double> expectedResult = Map.of( "GENRE ONE", 3.0, "GENRE TWO", 1.0 ); //when //then Assertions.assertDoesNotThrow(() -> { Map<String, Double> actualResult = movieService.getAverageMovieDurationForMovieGenre(); assertThat(actualResult, is(equalTo(expectedResult))); }); then(movieRepository).should(times(1)).findAll(); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("get most expensive movie for each genre") void test13() { //given List<Movie> movieList = getMovieList(); Map<String, List<Movie>> expectedResult = Map.of( "GENRE ONE", List.of(Movie.builder() .id(1) .duration(2) .genre("GENRE ONE") .price(new BigDecimal("35")) .releaseDate(LocalDate.of(2020, Month.OCTOBER, 20)) .title("TITLE ONE") .build(), Movie.builder() .id(2) .duration(4) .genre("GENRE ONE") .price(new BigDecimal("35")) .releaseDate(LocalDate.of(2022, Month.MARCH, 15)) .title("TITLE TWO") .build()), "GENRE TWO", Collections.singletonList(Movie.builder() .id(3) .duration(1) .genre("GENRE TWO") .price(new BigDecimal("40")) .releaseDate(LocalDate.of(2021, Month.APRIL, 21)) .title("TITLE THREE") .build()) ); given(movieRepository.findAll()) .willReturn(movieList); //when //then Assertions.assertDoesNotThrow(() -> { Map<String, List<Movie>> actualResult = movieService.getMostExpensiveMovieForEachGenre(); assertThat(actualResult, is(equalTo(expectedResult))); }); then(movieRepository).should(times(1)).findAll(); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("get cheapest movie for each genre") void test14() { //given List<Movie> movieList = getMovieList(); Map<String, List<Movie>> expectedResult = Map.of( "GENRE ONE", List.of(Movie.builder() .id(1) .duration(2) .genre("GENRE ONE") .price(new BigDecimal("35")) .releaseDate(LocalDate.of(2020, Month.OCTOBER, 20)) .title("TITLE ONE") .build(), Movie.builder() .id(2) .duration(4) .genre("GENRE ONE") .price(new BigDecimal("35")) .releaseDate(LocalDate.of(2022, Month.MARCH, 15)) .title("TITLE TWO") .build()), "GENRE TWO", Collections.singletonList(Movie.builder() .id(3) .duration(1) .genre("GENRE TWO") .price(new BigDecimal("40")) .releaseDate(LocalDate.of(2021, Month.APRIL, 21)) .title("TITLE THREE") .build()) ); given(movieRepository.findAll()).willReturn(movieList); //when //then Assertions.assertDoesNotThrow(() -> { Map<String, List<Movie>> actualResult = movieService.getCheapestMovieForEachGenre(); assertThat(actualResult, is(equalTo(expectedResult))); }); then(movieRepository).should(times(1)).findAll(); then(movieRepository).shouldHaveNoMoreInteractions(); } @Test @DisplayName("get the earliest premiere for movie genre") void test15() { //given given(movieRepository.findAll()).willReturn(getMovieList()); Map<String, Map<LocalDate, List<Movie>>> expectedResult = Map.of( "GENRE ONE", Map.of( LocalDate.of(2020, Month.OCTOBER, 20), Collections.singletonList(Movie.builder() .id(1) .duration(2) .genre("GENRE ONE") .price(new BigDecimal("35")) .releaseDate(LocalDate.of(2020, Month.OCTOBER, 20)) .title("TITLE ONE") .build())), "GENRE TWO", Map.of( LocalDate.of(2021, Month.APRIL, 21), Collections.singletonList(Movie.builder() .id(3) .duration(1) .genre("GENRE TWO") .price(new BigDecimal("40")) .releaseDate(LocalDate.of(2021, Month.APRIL, 21)) .title("TITLE THREE") .build()) )); //when //then Assertions.assertDoesNotThrow(() -> { Map<String, Map<LocalDate, List<Movie>>> actualResult = movieService.getTheEarliestPremiereForMovieGenre(); assertThat(actualResult, is(equalTo(expectedResult))); }); then(movieRepository).should(times(1)).findAll(); then(movieRepository).shouldHaveNoMoreInteractions(); } private List<Movie> getMovieList() { return List.of( Movie.builder() .id(1) .duration(2) .genre("GENRE ONE") .price(new BigDecimal("35")) .releaseDate(LocalDate.of(2020, Month.OCTOBER, 20)) .title("TITLE ONE") .build(), Movie.builder() .id(2) .duration(4) .genre("GENRE ONE") .price(new BigDecimal("35")) .releaseDate(LocalDate.of(2022, Month.MARCH, 15)) .title("TITLE TWO") .build(), Movie.builder() .id(3) .duration(1) .genre("GENRE TWO") .price(new BigDecimal("40")) .releaseDate(LocalDate.of(2021, Month.APRIL, 21)) .title("TITLE THREE") .build()); } }
92451916ec2dd0a1fe4238df5e3d280672ea8599
2,581
java
Java
json-templates/src/main/java/nl/softcause/jsontemplates/types/TypeException.java
rslijp/jsontemplates
005a7a47443b1b7677b78cdbd2c4176f578fb2e0
[ "MIT" ]
null
null
null
json-templates/src/main/java/nl/softcause/jsontemplates/types/TypeException.java
rslijp/jsontemplates
005a7a47443b1b7677b78cdbd2c4176f578fb2e0
[ "MIT" ]
null
null
null
json-templates/src/main/java/nl/softcause/jsontemplates/types/TypeException.java
rslijp/jsontemplates
005a7a47443b1b7677b78cdbd2c4176f578fb2e0
[ "MIT" ]
null
null
null
44.5
154
0.700891
1,003,247
package nl.softcause.jsontemplates.types; public class TypeException extends RuntimeException { protected TypeException(String msg) { super(msg); } public static TypeException invalidCast(Object src, IExpressionType type) { return new TypeException(String.format("%s is not an %s", src, type.getType())); } public static TypeException notFound(String typeName) { return new TypeException(String.format("%s is not an known type", typeName)); } public static TypeException notComparable(Class<?> subject) { return new TypeException(String.format("%s is not comparable", subject.getSimpleName())); } public static TypeException propertyAccess(String property, Class<?> subject) { return new TypeException(String.format("Error accessing %s on %s", property, subject.getSimpleName())); } public static TypeException onProperty(TypeException ex, Class subject, String property) { return new TypeException(String.format("%s on property %s.%s", ex, subject.getSimpleName(), property)); } public static TypeException firstClassCollectionOnly(Class<?> clazz) { return new TypeException(String.format( "Type erasure prevents type safety for the json template. Please use the following construct MyElement%s implements %s<MyElement>", clazz.getSimpleName(), clazz.getSimpleName())); } public static TypeException expected(IExpressionType type) { return new TypeException(String.format("Expeted something that could be interpreted as a %s", type.getType())); } public static TypeException firstClassMapOnly(Class<?> clazz) { return new TypeException(String.format( "Type erasure prevents type safety for the json template. Please use the following construct MyElement%s implements %s<String,MyElement>", clazz.getSimpleName(), clazz.getSimpleName())); } public static TypeException onlyMapWithStringKeysSupported(Class<?> clazz) { return new TypeException( String.format("Please use a map with a key type of type String for class %s", clazz.getSimpleName())); } public static TypeException noModelDefinition(String name) { return new TypeException(String.format("No model present to determine type of variable '%s'", name)); } public static TypeException conversionError(Object value, IExpressionType target) { return new TypeException(String.format("Can't convert '%s' to %s", value, target.getType())); } }
924519eba1d2c15475cfa16107389438217c6418
2,228
java
Java
src/main/java/com/bryanherger/udparser/spark/SparkSqlLoaderFactory.java
bryanherger/vertica-custom-udparsers
5d1120f8a6ce21a08b045bf152c50594e081b22a
[ "BSD-3-Clause" ]
null
null
null
src/main/java/com/bryanherger/udparser/spark/SparkSqlLoaderFactory.java
bryanherger/vertica-custom-udparsers
5d1120f8a6ce21a08b045bf152c50594e081b22a
[ "BSD-3-Clause" ]
null
null
null
src/main/java/com/bryanherger/udparser/spark/SparkSqlLoaderFactory.java
bryanherger/vertica-custom-udparsers
5d1120f8a6ce21a08b045bf152c50594e081b22a
[ "BSD-3-Clause" ]
1
2019-08-19T06:35:05.000Z
2019-08-19T06:35:05.000Z
42.846154
133
0.643627
1,003,248
package com.bryanherger.udparser.spark; import com.vertica.sdk.*; public class SparkSqlLoaderFactory extends ParserFactory { public static int MIN_ROWSET = 1; // Min rowset value public static int MAX_ROWSET = 10000; // Max rowset value public static int DEF_ROWSET = 100; // Default rowset public static int MAX_PRELEN = 2048; // Max predicate length public static int MAX_PRENUM = 10; // Max predicate number @Override public void plan(ServerInterface srvInterface, PerColumnParamReader perColumnParamReader, PlanContext planCtxt) throws UdfException { if (!srvInterface.getParamReader().containsParameter("query")) { throw new UdfException(0, "Error: SparkSqlLoader requires a 'query' string, the query to execute on the remote system"); } } @Override public UDParser prepare(ServerInterface srvInterface, PerColumnParamReader perColumnParamReader, PlanContext planCtxt, SizedColumnTypes returnType) { return new SparkSqlLoader(); } @Override public void getParameterType(ServerInterface srvInterface, SizedColumnTypes parameterTypes) { parameterTypes.addVarchar(65000, "query"); parameterTypes.addVarchar(65000, "partition"); parameterTypes.addVarchar(65000, "__query_col_name__"); parameterTypes.addVarchar(65000, "__query_col_idx__"); for ( int k = 0 ; k < MAX_PRENUM ; k++ ) { parameterTypes.addVarchar(MAX_PRELEN, "__pred_"+k+"__"); } parameterTypes.addInt("rowset"); parameterTypes.addBool("src_rfilter"); parameterTypes.addBool("src_cfilter"); // Spark //.master("local[1]") //.config("spark.sql.warehouse.dir","hdfs:///user/spark/warehouse") //.config("hive.metastore.uris","thrift://ip-172-31-26-110.ec2.internal:9083") parameterTypes.addVarchar(65000, "spark_master"); parameterTypes.addVarchar(65000, "spark_sql_warehouse_dir"); parameterTypes.addVarchar(65000, "spark_hive_metastore_uris"); } }
92451a063e6957d66d09533303089c63179712c4
1,716
java
Java
agile-itsm-web/agile-itsm-web-portal/src/main/java/br/com/centralit/citcorpore/integracao/IncidentesRelacionadosDAO.java
acfreitas/agile-itsm
2ba2da37fe75fdb3c0335857809210e83ef662a2
[ "Apache-2.0" ]
3
2019-02-21T09:24:58.000Z
2020-05-23T14:01:35.000Z
agile-itsm-web/agile-itsm-web-portal/src/main/java/br/com/centralit/citcorpore/integracao/IncidentesRelacionadosDAO.java
acfreitas/agile-itsm
2ba2da37fe75fdb3c0335857809210e83ef662a2
[ "Apache-2.0" ]
null
null
null
agile-itsm-web/agile-itsm-web-portal/src/main/java/br/com/centralit/citcorpore/integracao/IncidentesRelacionadosDAO.java
acfreitas/agile-itsm
2ba2da37fe75fdb3c0335857809210e83ef662a2
[ "Apache-2.0" ]
1
2019-09-15T14:14:54.000Z
2019-09-15T14:14:54.000Z
30.105263
114
0.766317
1,003,249
package br.com.centralit.citcorpore.integracao; import java.util.ArrayList; import java.util.Collection; import java.util.List; import br.com.centralit.citcorpore.bean.IncidentesRelacionadosDTO; import br.com.citframework.dto.IDto; import br.com.citframework.excecao.PersistenceException; import br.com.citframework.integracao.Condition; import br.com.citframework.integracao.CrudDaoDefaultImpl; import br.com.citframework.integracao.Field; import br.com.citframework.util.Constantes; public class IncidentesRelacionadosDAO extends CrudDaoDefaultImpl { public IncidentesRelacionadosDAO() { super(Constantes.getValue("DATABASE_ALIAS"), null); } public Class getBean() { return IncidentesRelacionadosDTO.class; } public Collection<Field> getFields() { Collection<Field> listFields = new ArrayList<>(); listFields.add(new Field("IDINCIDENTESRELACIONADOS", "idIncidentesRelacionados", true, true, false, false)); listFields.add(new Field("IDINCIDENTE", "idIncidente", false, false, false, false)); listFields.add(new Field("IDINCIDENTERELACIONADO", "idIncidenteRelacionado", false, false, false, false)); return listFields; } public String getTableName() { return "incidentesrelacionados"; } @Override public Collection find(IDto arg0) throws PersistenceException { return null; } @Override public Collection list() throws PersistenceException { return null; } public Collection<IncidentesRelacionadosDTO> findByIdIncidente(Integer idIncidente) throws PersistenceException { List condicao = new ArrayList(); condicao.add(new Condition("idIncidente", "=", idIncidente)); return super.findByCondition(condicao, null); } }
92451a61b07299cb5cba16fd415b7230d1cf2a8c
8,155
java
Java
src/main/java/tectonicus/gui/Gui.java
tectonicus/tectonicus
a787f902cb34009bb3169bc199fbb0d1f694dfad
[ "BSD-3-Clause" ]
129
2015-01-12T15:53:23.000Z
2022-01-27T18:02:44.000Z
src/main/java/tectonicus/gui/Gui.java
tectonicus/tectonicus
a787f902cb34009bb3169bc199fbb0d1f694dfad
[ "BSD-3-Clause" ]
122
2015-01-09T15:00:09.000Z
2022-03-31T07:42:30.000Z
src/main/java/tectonicus/gui/Gui.java
tectonicus/tectonicus
a787f902cb34009bb3169bc199fbb0d1f694dfad
[ "BSD-3-Clause" ]
24
2015-06-20T02:19:38.000Z
2022-01-01T22:03:35.000Z
23.101983
100
0.716125
1,003,250
/* * Copyright (c) 2020 Tectonicus contributors. All rights reserved. * * This file is part of Tectonicus. It is subject to the license terms in the LICENSE file found in * the top-level directory of this distribution. The full list of project contributors is contained * in the AUTHORS file found in the same location. * */ package tectonicus.gui; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.security.MessageDigest; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import tectonicus.ProgressListener; import tectonicus.TileRenderer; import tectonicus.configuration.Configuration; import tectonicus.configuration.MutableConfiguration; import tectonicus.configuration.MutableLayer; import tectonicus.configuration.MutableMap; // GUI todo list: // // 1. Get the basics working as soon as possible: // - browse to find world dir // - browse to specify output dir // - auto-detect minecraft.jar location // - 'start' button // - disable everything while rendering // - pop up dialog when finished // Proper progress bar // Progress bar needs some kind of animation to show it's still working and not frozen // Remember last export dir public class Gui { private final MessageDigest hashAlgorithm; private JFrame frame; private JPanel topPanel; private JPanel infoPanel; private JPanel simplePanel; private JPanel advancedPanel; private JPanel togglePanel; // Top info panel private JLabel infoText; // Simple options private WorldBrowserLine worldBrowser; private OutputBrowserLine outputBrowser; private MinecraftJarBrowserLine minecraftBrowser; // Bottom row private JButton startButton; private JButton toggleButton; private boolean isSimple; private TileRendererTask activeRender; private Thread workerThread; public Gui(MessageDigest hashAlgorithm) { /* try { // UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel"); } catch (Exception e) { e.printStackTrace(); } */ this.hashAlgorithm = hashAlgorithm; isSimple = true; frame = new JFrame("Tectonicus"); topPanel = new JPanel(); topPanel.setLayout( new BoxLayout(topPanel, BoxLayout.Y_AXIS)); infoPanel = createInfoPanel(); simplePanel = createSimplePanel(); advancedPanel = createAdvancedPanel(); advancedPanel.setVisible(false); togglePanel = createTogglePanel(); topPanel.add(infoPanel); topPanel.add(simplePanel); topPanel.add(advancedPanel); topPanel.add(togglePanel); topPanel.setBorder( new EmptyBorder(8, 8, 8, 8) ); frame.getContentPane().add(topPanel); frame.setMinimumSize( new Dimension(400, 10) ); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); internalOnControlModified(); } private JPanel createInfoPanel() { JPanel info = new JPanel(); infoText = new JLabel("Choose map options"); info.add(infoText); return info; } private JPanel createSimplePanel() { JPanel simple = new JPanel(); simple.setLayout( new BoxLayout(simple, BoxLayout.Y_AXIS)); worldBrowser = new WorldBrowserLine(frame); worldBrowser.addModifiedListener( new EnableStartHandler() ); simple.add( worldBrowser.getPanel() ); outputBrowser = new OutputBrowserLine(frame); outputBrowser.addModifiedListener( new EnableStartHandler() ); simple.add( outputBrowser.getPanel() ); minecraftBrowser = new MinecraftJarBrowserLine(frame); minecraftBrowser.addModifiedListener( new EnableStartHandler() ); simple.add( minecraftBrowser.getPanel() ); return simple; } private static JPanel createAdvancedPanel() { JPanel advanced = new JPanel(); advanced.add( new JLabel("advanced") ); return advanced; } private JPanel createTogglePanel() { JPanel toggle = new JPanel(); toggle.setLayout( new BorderLayout() ); startButton = new JButton("Start!"); toggle.add(startButton, BorderLayout.EAST); startButton.addActionListener( new StartHandler() ); toggleButton = new JButton("Show advanced options"); toggleButton.addActionListener(new ToggleHandler()); toggle.add(toggleButton, BorderLayout.WEST); return toggle; } public void setControlsEnabled(final boolean enabled) { worldBrowser.setEnabled(enabled); outputBrowser.setEnabled(enabled); minecraftBrowser.setEnabled(enabled); startButton.setEnabled(enabled); toggleButton.setEnabled(enabled); } public void display() { frame.setVisible(true); } private class ToggleHandler implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if (isSimple) { toggleButton.setText("Hide advanced options"); advancedPanel.setVisible(true); } else { toggleButton.setText("Show advanced options"); advancedPanel.setVisible(false); } frame.pack(); isSimple = !isSimple; } } private class StartHandler implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if (activeRender == null) { // Disable all controls setControlsEnabled(false); MutableConfiguration config = new MutableConfiguration(); MutableMap map = new MutableMap("Map0"); MutableLayer layer = new MutableLayer("LayerA", map.getId()); map.addLayer(layer); config.addMap(map); worldBrowser.apply(config); outputBrowser.apply(config); minecraftBrowser.apply(config); // Enable caching config.setUseCache(true); config.setCacheDir( new File(config.getOutputDir(), "config") ); // For testing // config.setMaxTiles(10); // Perform the rendering in a background thread activeRender = new TileRendererTask(config); workerThread = new Thread(activeRender, "Tile renderer thread"); workerThread.start(); startButton.setEnabled(true); startButton.setText("Stop"); } else { // Abort the renderer activeRender.abort(); } } } private class TileRendererTask implements Runnable { private final Configuration config; private TileRenderer renderer; public TileRendererTask(Configuration config) { this.config = config; } @Override public void run() { try { ProgressHandler progressHandler = new ProgressHandler(); renderer = new TileRenderer(config, progressHandler, hashAlgorithm); progressHandler.onTaskStarted(TileRenderer.Task.LOADING_WORLD.toString()); TileRenderer.Result res = renderer.output(); if (!res.aborted) { String message = "Rendering complete!\n" + "Map exported to "+res.htmlFile.getAbsolutePath(); JOptionPane.showMessageDialog(frame, message, "Finished!", JOptionPane.INFORMATION_MESSAGE); } else { // Aborted, do nothing? } activeRender = null; workerThread = null; // Reenable all the buttons startButton.setText("Start"); setControlsEnabled(true); } catch (Exception ex) { ex.printStackTrace(); } } public void abort() { renderer.abort(); } } private void internalOnControlModified() { if (worldBrowser.isOk() && outputBrowser.isOk() && minecraftBrowser.isOk()) { startButton.setEnabled(true); } else { startButton.setEnabled(false); } } private class EnableStartHandler implements ControlModifiedListener { @Override public void onControlModified() { internalOnControlModified(); } } private class ProgressHandler implements ProgressListener { private String taskName; @Override public void onTaskStarted(String taskName) { this.taskName = taskName; infoText.setText(taskName); } @Override public void onTaskUpdate(final int num, final int ofTotalNum) { infoText.setText(taskName + " ("+num+" of "+ofTotalNum+")"); } } }
92451b2858ee4697400347820b2dedb2811d9a5e
2,886
java
Java
src/main/java/co/aurasphere/botmill/fb/event/FbBotMillEventType.java
BotMill/facebot
d94da3615a7339822c137ef75c92a03d791ee969
[ "MIT" ]
80
2016-12-24T06:29:12.000Z
2020-09-06T13:40:17.000Z
src/main/java/co/aurasphere/botmill/fb/event/FbBotMillEventType.java
creativeprogramming/fb-botmill
d94da3615a7339822c137ef75c92a03d791ee969
[ "MIT" ]
100
2016-12-23T22:09:58.000Z
2018-06-21T20:02:15.000Z
src/main/java/co/aurasphere/botmill/fb/event/FbBotMillEventType.java
creativeprogramming/fb-botmill
d94da3615a7339822c137ef75c92a03d791ee969
[ "MIT" ]
36
2016-12-28T20:51:49.000Z
2020-04-26T06:04:35.000Z
20.614286
89
0.699238
1,003,251
/* * MIT License * * Copyright (c) 2016 BotMill.io * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package co.aurasphere.botmill.fb.event; // TODO: Auto-generated Javadoc /** * Enum that represents all the possible callbacks from Facebook's Messenger * Platform. * * @author Donato Rimenti * @author Alvin Reyes * @see <a href= * "https://developers.facebook.com/docs/messenger-platform/webhook-reference#setup" * >Facebook's Messenger Platform Callbacks Documentation</a> * */ public enum FbBotMillEventType { /** The file. */ FILE, /** The video. */ VIDEO, /** The audio. */ AUDIO, /** The image. */ IMAGE, /** * Represents message callback. */ MESSAGE, /** * The message pattern. */ MESSAGE_PATTERN, /** * The quick reply message. */ QUICK_REPLY_MESSAGE, /** * The quick reply message pattern. */ QUICK_REPLY_MESSAGE_PATTERN, /** * Represents messaging_postback callback. */ POSTBACK, /** * The postback pattern. */ POSTBACK_PATTERN, /** * Represents messaging_optins callback. */ AUTHENTICATION, /** * Represents an account linking callback. There's no defined event for this * on Messenger Platform. */ ACCOUNT_LINKING, /** * Represents message_deliveries callback. */ DELIVERY, /** * Represents message_reads callback. */ READ, /** * Represents message_echoes callback. */ ECHO, /** * Represents messaging_checkout_updates callback. */ CHECKOUT_UPDATE, /** * Represents messaging_referral callback. */ REFERRAL, /** * Represents messaging_payments callback. */ PAYMENT, /** * Represents a Quick Reply location callback. */ LOCATION, /** * Represents messaging_pre_checkouts callback. */ PRE_CHECKOUT, /** * Represents any of the previous callbacks. Used as utility event. */ ANY; }
92451bec64d66898d9999d10ce505912601aba1f
1,700
java
Java
fruit-core/src/main/java/com/fruit/service/management/impl/EnvironmentServiceImpl.java
tanliu/fruit
3a9ee76699435061fe603781bec041b7de455347
[ "Apache-2.0" ]
null
null
null
fruit-core/src/main/java/com/fruit/service/management/impl/EnvironmentServiceImpl.java
tanliu/fruit
3a9ee76699435061fe603781bec041b7de455347
[ "Apache-2.0" ]
null
null
null
fruit-core/src/main/java/com/fruit/service/management/impl/EnvironmentServiceImpl.java
tanliu/fruit
3a9ee76699435061fe603781bec041b7de455347
[ "Apache-2.0" ]
null
null
null
32.692308
184
0.697647
1,003,252
package com.fruit.service.management.impl; import com.fruit.base.BaseServiceImpl; import com.fruit.dao.management.EnvironmentDao; import com.fruit.entity.management.Environment; import com.fruit.service.management.EnvironmentService; import com.fruit.utils.ImageBean; import com.fruit.utils.ParamTool; import net.sf.json.JSONArray; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.Map; /** * Created by TanLiu on 2017/3/21. */ @Service public class EnvironmentServiceImpl extends BaseServiceImpl<Environment> implements EnvironmentService { EnvironmentDao environmentDao; @Resource(name=EnvironmentDao.DAO_NAME) public void setEnvironmentDao(EnvironmentDao environmentDao) { super.setDaoSupport(environmentDao); this.environmentDao = environmentDao; } /**获取品种详细信息 * @param id * @return */ public String getEnvironmentDetail(int id){ StringBuffer sql = new StringBuffer(); sql.append("select t.id,t.soiltype,t.soilgrade,t.airquality,t.waterquality,t.pictures,DATE_FORMAT(t.createTime, '%Y-%m-%d %H:%i:%s') createTime from environment t where id=?"); Map<String, Object> result = findUniqueToMap(sql.toString(),id); if(result!=null){ Object picobject = result.get("pictures"); if(picobject!=null){ String pictures = picobject.toString(); List<ImageBean> list = ImageBean.getImageList(pictures); result.put("pictures", list); } } String str = ParamTool.subContent(JSONArray.fromObject(result).toString()); return str; } }
92451ce28dda6d26e454b005f5c8389d45d6966e
7,343
java
Java
src/main/java/org/javastack/tinyurl/TinyQR.java
ggrandes/tinyurl
7b7d989384c9ea7ae2c130a609f49a76ae5de0a2
[ "Apache-2.0" ]
13
2015-09-25T11:50:59.000Z
2022-02-23T17:57:14.000Z
src/main/java/org/javastack/tinyurl/TinyQR.java
ggrandes/tinyurl
7b7d989384c9ea7ae2c130a609f49a76ae5de0a2
[ "Apache-2.0" ]
6
2015-09-23T12:10:39.000Z
2022-03-10T22:17:50.000Z
src/main/java/org/javastack/tinyurl/TinyQR.java
ggrandes/tinyurl
7b7d989384c9ea7ae2c130a609f49a76ae5de0a2
[ "Apache-2.0" ]
7
2017-08-05T03:58:01.000Z
2021-07-21T06:38:23.000Z
32.348018
102
0.71129
1,003,253
/* * 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.javastack.tinyurl; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.EnumMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.UUID; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.apache.log4j.MDC; import org.javastack.mapexpression.InvalidExpression; import org.javastack.qr.BarcodeFormat; import org.javastack.qr.BitMatrix; import org.javastack.qr.EncodeHintType; import org.javastack.qr.ErrorCorrectionLevel; import org.javastack.qr.MatrixToImageWriter; import org.javastack.qr.QRCodeWriter; import org.javastack.qr.WriterException; /** * Simple QR Generation * * @author Guillermo Grandes / guillermo.grandes[at]gmail.com */ public class TinyQR extends HttpServlet { static final Logger log = Logger.getLogger(TinyQR.class); private static final long serialVersionUID = 42L; private static final String BASE_URI_TINYURL = "/r/"; // defined in web.xml // private static final String CFG_BASE_URL = "base.url"; // https://tiny.javastack.org/r/ private static final String CFG_QR_SIZE_MIN = "qr.size.min"; private static final String CFG_QR_SIZE_MAX = "qr.size.max"; private static final String CFG_QR_SIZE_DEFAULT = "qr.size.default"; // private Config config; private String baseURL; private int qrSizeMin, qrSizeMax, qrSizeDefault; private LinkedHashMap<String, byte[]> qrCache; @Override public void init() throws ServletException { try { init0(); } catch (Exception e) { throw new ServletException(e); } } private void init0() throws IOException, InvalidExpression { // Config Source final String configSource = System.getProperty(Config.PROP_CONFIG, Config.DEF_CONFIG_FILE); log.info("ConfigSource: " + configSource); config = new Config(configSource); baseURL = config.get(CFG_BASE_URL); qrSizeMin = Math.max(config.getInt(CFG_QR_SIZE_MIN, Constants.DEF_QR_SIZE_MIN), 50); qrSizeMax = Math.min(config.getInt(CFG_QR_SIZE_MAX, Constants.DEF_QR_SIZE_MAX), 2000); qrSizeDefault = config.getInt(CFG_QR_SIZE_DEFAULT, Constants.DEF_QR_SIZE); if ((baseURL == null) || baseURL.isEmpty()) { log.warn("baseURL: undefined"); } else { log.info("baseURL: " + baseURL); } // Init cache qrCache = new LinkedHashMap<String, byte[]>() { private static final long serialVersionUID = 42L; @Override protected boolean removeEldestEntry(final Map.Entry<String, byte[]> eldest) { return size() > 128; } }; } @Override public void destroy() { } @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { try { MDC.put(Constants.MDC_IP, request.getRemoteAddr()); MDC.put(Constants.MDC_ID, getNewID()); doGet0(request, response); } finally { MDC.clear(); } } private void doGet0(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { final int size = Math.min(qrSizeMax, Math.max(qrSizeMin, // parseInt(request.getParameter("size"), qrSizeDefault))); final String pathInfo = request.getPathInfo(); final String key = getPathInfoKey(pathInfo); if (key != null) { final String cacheKey = key + ":" + size; byte[] qr = null; synchronized (qrCache) { qr = qrCache.get(cacheKey); } if (qr != null) { log.info("QR cache found id=" + key + " size=" + qr.length); } else { final String urlBase = getBaseURL(request); final String input = urlBase + key; final long begin = System.currentTimeMillis(); qr = generateQR(input, size); synchronized (qrCache) { qrCache.put(cacheKey, qr); } log.info("QR generated (" + (System.currentTimeMillis() - begin) + "ms)" // + " pixels=" + size + " length=" + qr.length + " input=" + input); } // Send response sendResponse(response, qr); return; } final PrintWriter out = response.getWriter(); sendError(response, out, HttpServletResponse.SC_NOT_FOUND, "Not Found"); } private static final byte[] generateQR(final String input, final int size) throws IOException { final Map<EncodeHintType, Object> hints = new EnumMap<EncodeHintType, Object>(EncodeHintType.class); hints.put(EncodeHintType.MARGIN, 1); hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); // Default ISO-8859-1 hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); try { final BitMatrix matrix = new QRCodeWriter().encode(input, // BarcodeFormat.QR_CODE, // size, size, // 300x300 hints); final ByteArrayOutputStream imageOut = new ByteArrayOutputStream(1024); MatrixToImageWriter.writeToStream(matrix, "PNG", imageOut); return imageOut.toByteArray(); } catch (WriterException e) { throw new IOException(e); } } private static final String getNewID() { return UUID.randomUUID().toString(); } private static final void sendResponse(final HttpServletResponse response, final byte[] qr) throws IOException { // Send Response response.setContentType("image/png"); response.setContentLength(qr.length); response.setHeader("Cache-Control", "public"); response.getOutputStream().write(qr); } private static final void sendError(final HttpServletResponse response, final PrintWriter out, final int status, final String msg) { response.setContentType("text/plain; charset=ISO-8859-1"); response.setStatus(status); out.println(msg); } private final String getBaseURL(final HttpServletRequest request) { if ((baseURL != null) && !baseURL.isEmpty()) { return baseURL; } final StringBuffer urlBase = request.getRequestURL(); final int l1 = request.getServletPath().length(); final int l2 = request.getPathInfo().length(); urlBase.setLength(urlBase.length() - l1 - l2); urlBase.append(BASE_URI_TINYURL); return urlBase.toString(); } private static final int parseInt(final String in, final int def) { try { if ((in != null) && !in.isEmpty()) { return Integer.parseInt(in); } } catch (Exception ign) { } return def; } private static final String getPathInfoKey(final String pathInfo) { if (pathInfo == null) return null; if (pathInfo.isEmpty()) return null; final int len = pathInfo.length(); for (int i = 1; i < len; i++) { final char c = pathInfo.charAt(i); if ((c >= 'A') && (c <= 'Z')) continue; if ((c >= 'a') && (c <= 'z')) continue; if ((c >= '0') && (c <= '9')) continue; if ((c == '-') || (c == '_')) continue; log.warn("Invalid path: " + pathInfo); return null; } return pathInfo.substring(1); } }
92451d91fa72c50d5e32f090bc9f4575a1fccbfd
156
java
Java
src/main/java/com/twinkle/user/repository/dao/UserDao.java
tianduo4/twinkle
ef75f40b2b071bc29014cb712fee4e485a86a615
[ "MIT" ]
null
null
null
src/main/java/com/twinkle/user/repository/dao/UserDao.java
tianduo4/twinkle
ef75f40b2b071bc29014cb712fee4e485a86a615
[ "MIT" ]
null
null
null
src/main/java/com/twinkle/user/repository/dao/UserDao.java
tianduo4/twinkle
ef75f40b2b071bc29014cb712fee4e485a86a615
[ "MIT" ]
null
null
null
14.181818
41
0.615385
1,003,254
package com.twinkle.user.repository.dao; /** * description: 会员服务 * * @author :King * @date :2019/1/12 11:19 */ public interface UserDao { }
92451e65ef8316b1dbafecea71a110d94ffacb69
518
java
Java
SampleApp/src/main/java/me/leolin/shortcutbadger/example/NetworkChangeReceiver.java
nieldeokar/ShortcutBadger
b18ad49bc0985ebeb13cd12bff71d31f8642aef9
[ "Apache-2.0" ]
1
2021-02-07T19:01:15.000Z
2021-02-07T19:01:15.000Z
SampleApp/src/main/java/me/leolin/shortcutbadger/example/NetworkChangeReceiver.java
nieldeokar/ShortcutBadger
b18ad49bc0985ebeb13cd12bff71d31f8642aef9
[ "Apache-2.0" ]
null
null
null
SampleApp/src/main/java/me/leolin/shortcutbadger/example/NetworkChangeReceiver.java
nieldeokar/ShortcutBadger
b18ad49bc0985ebeb13cd12bff71d31f8642aef9
[ "Apache-2.0" ]
null
null
null
22.521739
62
0.675676
1,003,255
package me.leolin.shortcutbadger.example; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; import android.widget.Toast; public class NetworkChangeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { try { Log.e("ABCD", "Conectivity Failure !!! "); } catch (NullPointerException e) { e.printStackTrace(); } } }
92451ef0de0cd9e0b89159283bdea43bb365a704
394
java
Java
ExemplosOOP/src/veiculos/Exemplo001.java
Vandeilsonln/BootCamp_Java
5565a053d739a09b4dde7a6c1ef2b3536de243d9
[ "MIT" ]
null
null
null
ExemplosOOP/src/veiculos/Exemplo001.java
Vandeilsonln/BootCamp_Java
5565a053d739a09b4dde7a6c1ef2b3536de243d9
[ "MIT" ]
null
null
null
ExemplosOOP/src/veiculos/Exemplo001.java
Vandeilsonln/BootCamp_Java
5565a053d739a09b4dde7a6c1ef2b3536de243d9
[ "MIT" ]
null
null
null
24.625
45
0.614213
1,003,256
package veiculos; public class Exemplo001 { public static void main(String[] args){ Carro carro = new Carro(); carro.setQuantidadeDePortas(4); carro.setMarca("Nissan"); carro.setModelo("March"); Motocicleta moto = new Motocicleta(); moto.setMarca("Ducati"); moto.setModelo("StreetFighter"); moto.setCilidradas(850); } }
92451fa11e4f37ac19efe8a850803d1da93d50d3
4,767
java
Java
core/src/test/java/org/mindtrails/persistence/ParticipantRepositoryTest.java
Diheng/MindTrails
506ff04b8da36e27a76c7259a53f54dd968c3fff
[ "MIT" ]
null
null
null
core/src/test/java/org/mindtrails/persistence/ParticipantRepositoryTest.java
Diheng/MindTrails
506ff04b8da36e27a76c7259a53f54dd968c3fff
[ "MIT" ]
null
null
null
core/src/test/java/org/mindtrails/persistence/ParticipantRepositoryTest.java
Diheng/MindTrails
506ff04b8da36e27a76c7259a53f54dd968c3fff
[ "MIT" ]
1
2016-07-18T18:48:25.000Z
2016-07-18T18:48:25.000Z
33.659574
90
0.699326
1,003,257
package org.mindtrails.persistence; import org.mindtrails.Application; import org.mindtrails.MockClasses.TestStudy; import org.mindtrails.domain.tracking.EmailLog; import org.mindtrails.domain.tracking.GiftLog; import org.mindtrails.domain.Participant; import org.mindtrails.domain.PasswordToken; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.crypto.password.StandardPasswordEncoder; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; import java.util.Date; /** * Created with IntelliJ IDEA. * User: dan * Date: 3/18/14 * Time: 6:58 AM * Assure that Participants are correctly stored and retrieved from the database. */ @Transactional @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = Application.class) public class ParticipantRepositoryTest { @Autowired protected ParticipantRepository participantRepository; @Test public void testPasswordIsEncryptedWhenStored() { Participant p; String password = "Abcdefg1#"; StandardPasswordEncoder encoder = new StandardPasswordEncoder(); p = new Participant("Dan Funk", "[email protected]", false); p.updatePassword(password); Assert.assertNotNull(p.getPassword()); Assert.assertNotSame(password, p.getPassword()); Assert.assertTrue(encoder.matches(password, p.getPassword())); // If the password isn't set, it doesn't overwrite the DAO. p.updatePassword(null); Assert.assertNotNull(p.getPassword()); Assert.assertNotSame(password, p.getPassword()); Assert.assertTrue(encoder.matches(password, p.getPassword())); } @Test @Transactional public void savedEmailLogSurfacesInReturnedParticipant() { Participant participant; EmailLog log; EmailLog log2; // Create a participant participant = new Participant("John", "[email protected]", false); participant.setStudy(new TestStudy()); log = new EmailLog(participant, "day2"); participant.addEmailLog(log); participantRepository.save(participant); participantRepository.flush(); // Participant should have an id now that it is saved. Assert.assertNotNull(participant.getId()); // Verify that the log message is returned, when loading that participant back up. participant = participantRepository.findOne(participant.getId()); Assert.assertNotNull(participant); Assert.assertNotNull(participant.getEmailLogs()); Assert.assertEquals(1, participant.getEmailLogs().size()); log = participant.getEmailLogs().iterator().next(); Assert.assertEquals("day2", log.getEmailType()); Assert.assertNotNull(log.getDateSent()); } @Test @Transactional public void giftLogSurfacesInReturnedParticipant() { Participant participant; GiftLog logDao; GiftLog log; participant = new Participant("Dan", "[email protected]", false); logDao = new GiftLog(participant, "code123", "SESSION1"); participant.addGiftLog(logDao); participantRepository.save(participant); participantRepository.flush(); Assert.assertNotNull(participant.getId()); Assert.assertNotNull(participant); Assert.assertNotNull(participant.getGiftLogs()); Assert.assertEquals(1, participant.getGiftLogs().size()); logDao = participant.getGiftLogs().iterator().next(); Assert.assertEquals("code123", logDao.getOrderId()); Assert.assertNotNull(logDao.getDateSent()); } @Test @Transactional public void testFindByToken() { Participant participant; Participant p, p2; PasswordToken token; String tokenString = "abcfedf"; // Create a participant participant = new Participant("John", "[email protected]", false); // Create a token DAO object token = new PasswordToken(participant, new Date(), tokenString); // Connect the two and save. participant.setPasswordToken(token); participantRepository.save(participant); participantRepository.flush(); // Find the participant by the token. participant = participantRepository.findByToken(tokenString); Assert.assertNotNull(participant); Assert.assertEquals(tokenString, participant.getPasswordToken().getToken()); Assert.assertEquals("[email protected]", participant.getEmail()); } }
92452124c3e0c2c71b642c5c15e6f517084a4266
457
java
Java
src/Stop.java
sAspen/RobotLanguageInterpreter
8c6cbf3d1eb12306da91550bb066cc1ef00abfd4
[ "MIT" ]
null
null
null
src/Stop.java
sAspen/RobotLanguageInterpreter
8c6cbf3d1eb12306da91550bb066cc1ef00abfd4
[ "MIT" ]
null
null
null
src/Stop.java
sAspen/RobotLanguageInterpreter
8c6cbf3d1eb12306da91550bb066cc1ef00abfd4
[ "MIT" ]
null
null
null
16.321429
65
0.601751
1,003,258
public class Stop extends Stmt { /** * Pointer to the ROBOL system environment. */ private Grid grid_Global; public Stop() { } public void setGrid_Global(Grid grid_ins) { grid_Global = grid_ins; } @Override public void interpret() { System.out.println("**************************************\n" + "The result is " + grid_Global.stateToString()); System.exit(0); } @Override public String toString() { return "stop"; } }
9245237765523d47bcd0777abca2d130556f6b8a
768
java
Java
src/main/java/chapter05/section01/thread_5_1_3/pro_1_timerTest3/Run.java
turoDog/java-multi-thread-programming
cb0d5e1735577fb76e57ec2b53d692c8063d6d66
[ "Apache-2.0" ]
1
2019-11-04T14:43:48.000Z
2019-11-04T14:43:48.000Z
src/main/java/chapter05/section01/thread_5_1_3/pro_1_timerTest3/Run.java
turoDog/java-multi-thread-programming
cb0d5e1735577fb76e57ec2b53d692c8063d6d66
[ "Apache-2.0" ]
null
null
null
src/main/java/chapter05/section01/thread_5_1_3/pro_1_timerTest3/Run.java
turoDog/java-multi-thread-programming
cb0d5e1735577fb76e57ec2b53d692c8063d6d66
[ "Apache-2.0" ]
null
null
null
24.1875
71
0.638243
1,003,259
package chapter05.section01.thread_5_1_3.pro_1_timerTest3; import java.util.Date; import java.util.Timer; import java.util.TimerTask; /** * Project Name:java-multi-thread-programming <br/> * Package Name:chapter05.section01.thread_5_1_3.pro_1_timerTest3 <br/> * Date:2019/11/28 14:32 <br/> * * @author <a href="mailto:[email protected]">chenzy</a><br/> */ public class Run { static public class MyTask extends TimerTask { @Override public void run() { System.out.println("运行了!时间为:" + new Date()); } } public static void main(String[] args) { MyTask task = new MyTask(); Timer timer = new Timer(); System.out.println("当前时间:" + new Date()); timer.schedule(task, 70000); } }
924523853c76aad996c506db2d48d99d63fc01bb
1,220
java
Java
cloudnet/src/main/java/de/dytanic/cloudnet/conf/IConfigurationRegistry.java
hammermaps/CloudNet-v3
7bb1beb1b06eb44216dbed3f7fc98ba1ad372737
[ "Apache-2.0" ]
2
2021-03-08T19:59:38.000Z
2021-04-24T11:41:11.000Z
cloudnet/src/main/java/de/dytanic/cloudnet/conf/IConfigurationRegistry.java
KxmischesDomi/CloudNet-v3
1b6bc79f839c1a30dac9a499f510cee204205279
[ "Apache-2.0" ]
4
2021-12-22T05:18:12.000Z
2022-03-07T05:22:37.000Z
cloudnet/src/main/java/de/dytanic/cloudnet/conf/IConfigurationRegistry.java
KxmischesDomi/CloudNet-v3
1b6bc79f839c1a30dac9a499f510cee204205279
[ "Apache-2.0" ]
null
null
null
21.403509
58
0.711475
1,003,260
package de.dytanic.cloudnet.conf; import java.lang.reflect.Type; public interface IConfigurationRegistry { IConfigurationRegistry put(String key, Object object); IConfigurationRegistry put(String key, String string); IConfigurationRegistry put(String key, Number number); IConfigurationRegistry put(String key, Boolean bool); IConfigurationRegistry put(String key, byte[] bytes); IConfigurationRegistry remove(String key); boolean contains(String key); <T> T getObject(String key, Class<T> clazz); <T> T getObject(String key, Type type); String getString(String key); String getString(String key, String def); Integer getInt(String key); Integer getInt(String key, Integer def); Double getDouble(String key); Double getDouble(String key, Double def); Short getShort(String key); Short getShort(String key, Short def); Long getLong(String key); Long getLong(String key, Long def); Boolean getBoolean(String key); Boolean getBoolean(String key, Boolean def); byte[] getBytes(String key); byte[] getBytes(String key, byte[] bytes); IConfigurationRegistry save(); IConfigurationRegistry load(); }
92452562927acbc26f36a36f3a452b2dbaf1c11a
10,906
java
Java
dioritos/src/main/java/org/diorite/impl/client/Main.java
XakepSDK/Diorite
d69adecfbe8da9c1d492e29349f7b43e0e0c4b29
[ "MIT" ]
3
2016-12-23T22:37:31.000Z
2019-09-02T14:46:12.000Z
dioritos/src/main/java/org/diorite/impl/client/Main.java
XakepSDK/Diorite
d69adecfbe8da9c1d492e29349f7b43e0e0c4b29
[ "MIT" ]
1
2016-08-13T16:43:41.000Z
2016-08-13T17:33:29.000Z
dioritos/src/main/java/org/diorite/impl/client/Main.java
Diorite/Diorite-old
bfe35f695876f633ae970442f673188e4ff99c9b
[ "MIT" ]
6
2017-10-28T14:01:23.000Z
2020-06-21T20:40:55.000Z
38.811388
239
0.631487
1,003,261
/* * The MIT License (MIT) * * Copyright (c) 2016. Diorite (by Bartłomiej Mazur (aka GotoFinal)) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package org.diorite.impl.client; import static org.lwjgl.glfw.Callbacks.errorCallbackPrint; import static org.lwjgl.glfw.GLFW.*; import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.system.MemoryUtil.NULL; import java.net.InetAddress; import java.net.Proxy; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.util.Collections; import org.lwjgl.Sys; import org.lwjgl.glfw.GLFWErrorCallback; import org.lwjgl.glfw.GLFWKeyCallback; import org.lwjgl.glfw.GLFWWindowSizeCallback; import org.lwjgl.glfw.GLFWvidmode; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GLContext; import org.diorite.impl.CoreMain; import org.diorite.impl.DioriteCore; import org.diorite.impl.client.connection.ClientConnection; import org.diorite.utils.math.DioriteRandomUtils; import joptsimple.OptionSet; @SuppressWarnings({"MagicNumber", "ClassHasNoToStringMethod"}) public class Main { static { SharedLibraryLoader.load(); System.out.println("Loaded LWJGL library."); } // We need to strongly reference callback instances. private GLFWErrorCallback errorCallback; private GLFWKeyCallback keyCallback; private GLFWWindowSizeCallback resizeCallback; private volatile int width; private volatile int height; private volatile boolean stop = false; // The window handle private long window; public void run(final OptionSet options) { System.out.println("Hello LWJGL " + Sys.getVersion() + "!"); this.width = (int) options.valueOf("width"); this.height = (int) options.valueOf("height"); final Thread thread = new Thread(() -> { try { this.init(); this.loop(); // Release window and window callbacks glfwDestroyWindow(this.window); DioriteCore.getInstance().stop(); } finally { this.cleanup(); } }, "GL"); thread.setDaemon(false); thread.start(); try { new DioriteClient(Proxy.NO_PROXY, options).start(options); } catch (final Throwable e) { e.printStackTrace(); } finally { this.stop = true; } } private void cleanup() { this.keyCallback.release(); glfwTerminate(); this.errorCallback.release(); this.resizeCallback.release(); } private void init() { // Setup an error callback. The default implementation // will print the error message in System.err. glfwSetErrorCallback(this.errorCallback = errorCallbackPrint(System.err)); // Initialize GLFW. Most GLFW functions will not work before doing this. if (glfwInit() != GL11.GL_TRUE) { throw new IllegalStateException("Unable to initialize GLFW"); } // Configure our window glfwDefaultWindowHints(); // optional, the current window hints are already the default glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable // Create the window this.window = glfwCreateWindow(this.width, this.height, "DioritOS", NULL, NULL); if (this.window == NULL) { throw new RuntimeException("Failed to create the GLFW window"); } this.resizeCallback = GLFWWindowSizeCallback(this::handleResize); // Setup a key callback. It will be called every time a key is pressed, repeated or released. glfwSetKeyCallback(this.window, this.keyCallback = new MyGLFWResizeKeyCallback()); // Get the resolution of the primary monitor final ByteBuffer vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); // Center our window glfwSetWindowPos(this.window, (GLFWvidmode.width(vidmode) - this.width) / 2, (GLFWvidmode.height(vidmode) - this.height) / 2); // Make the OpenGL context current glfwMakeContextCurrent(this.window); // Enable v-sync glfwSwapInterval(1); // Make the window visible glfwShowWindow(this.window); glfwSetWindowSizeCallback(this.window, this.resizeCallback); } private void handleResize(final long window, final int width, final int height) { if ((width != this.width) || (height != this.height)) { Main.this.width = width; Main.this.height = height; // Get the resolution of the primary monitor final ByteBuffer vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); // Center our window glfwSetWindowPos(this.window, (GLFWvidmode.width(vidmode) - this.width) / 2, (GLFWvidmode.height(vidmode) - this.height) / 2); glViewport(0, 0, width, height); } } private void loop() { // This line is critical for LWJGL's interoperation with GLFW's // OpenGL context, or any context that is managed externally. // LWJGL detects the context that is current in the current thread, // creates the ContextCapabilities instance and makes the OpenGL // bindings available for use. GLContext.createFromCurrent(); // Set the clear color glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Run the rendering loop until the user has attempted to close // the window or has pressed the ESCAPE key. while (glfwWindowShouldClose(this.window) == GL_FALSE) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer // useless code, deal with it. for (int i = 0, k = DioriteRandomUtils.nextInt(50); i < k; i++) { rect(DioriteRandomUtils.getRandomDouble(- 1, 1), DioriteRandomUtils.getRandomDouble(- 1, 1), DioriteRandomUtils.getRandomDouble(- 1, 1), DioriteRandomUtils.getRandomDouble(- 1, 1), DioriteRandomUtils.getRandomDouble(0, 5)); } glfwSwapBuffers(this.window); // swap the color buffers // Poll for window events. The key callback above will only be // invoked during this call. glfwPollEvents(); if (this.stop) { glfwSetWindowShouldClose(this.window, GL_TRUE); break; } try { Thread.sleep(300); } catch (final InterruptedException e) { e.printStackTrace(); } } } public static void rect(final double x, final double y, final double width, final double height, final double r) { glPushMatrix(); glTranslated(x, y, 0); glRotated(r, 0, 0, 1); glColor4f(DioriteRandomUtils.nextFloat(), DioriteRandomUtils.nextFloat(), DioriteRandomUtils.nextFloat(), DioriteRandomUtils.nextFloat()); glBegin(GL_QUADS); glVertex2d(0, 0); glVertex2d(0, height); glVertex2d(width, height); glVertex2d(width, 0); glEnd(); glPopMatrix(); } public static void main(final String[] args) { DioriteCore.getInitPipeline().addLast("Diorite|initConnection", (s, p, data) -> { s.setHostname(data.options.has("hostname") ? data.options.valueOf("hostname").toString() : s.getConfig().getHostname()); s.setPort(data.options.has("port") ? (int) data.options.valueOf("port") : s.getConfig().getPort()); s.setConnectionHandler(new ClientConnection(s)); s.getConnectionHandler().start(); }); DioriteCore.getStartPipeline().addLast("DioriteCore|Run", (s, p, options) -> { System.out.println("Started Diorite v" + s.getVersion() + " core!"); s.run(); }); // // // TODO: remove that, client should be able to select server. DioriteCore.getStartPipeline().addBefore("DioriteCore|Run", "Diorite|bindConnection", (s, p, options) -> { try { System.setProperty("io.netty.eventLoopThreads", options.has("netty") ? options.valueOf("netty").toString() : Integer.toString(s.getConfig().getNettyThreads())); System.out.println("Starting connecting on " + s.getHostname() + ":" + s.getPort()); s.getConnectionHandler().init(InetAddress.getByName(s.getHostname()), s.getPort(), s.getConfig().isUseNativeTransport()); System.out.println("Connected to " + s.getHostname() + ":" + s.getPort()); } catch (final UnknownHostException e) { e.printStackTrace(); } }); final OptionSet options = CoreMain.main(args, false, p -> { p.acceptsAll(Collections.singletonList("width"), "width of screen").withRequiredArg().ofType(int.class).describedAs("width").defaultsTo(854); p.acceptsAll(Collections.singletonList("height"), "height of screen").withRequiredArg().ofType(int.class).describedAs("width").defaultsTo(480); }); new Main().run(options); } private static class MyGLFWResizeKeyCallback extends GLFWKeyCallback { @Override public void invoke(final long window, final int key, final int scancode, final int action, final int mods) { if ((key == GLFW_KEY_ESCAPE) && (action == GLFW_RELEASE)) { glfwSetWindowShouldClose(window, GL_TRUE); // We will detect this in our rendering loop } } } }
924525b00107af3d5f445d259e18e7adc11b11cf
1,649
java
Java
markwon-simple-ext/src/main/java/io/noties/markwon/simple/ext/SimpleExtDelimiterProcessor.java
vfishv/Markwon
a26c13c93a0bccb828118b8df4266d8249993cd0
[ "Apache-2.0" ]
2,113
2017-08-28T21:25:25.000Z
2022-03-31T17:40:26.000Z
markwon-simple-ext/src/main/java/io/noties/markwon/simple/ext/SimpleExtDelimiterProcessor.java
vfishv/Markwon
a26c13c93a0bccb828118b8df4266d8249993cd0
[ "Apache-2.0" ]
357
2017-10-16T15:07:13.000Z
2022-03-28T04:24:17.000Z
markwon-simple-ext/src/main/java/io/noties/markwon/simple/ext/SimpleExtDelimiterProcessor.java
vfishv/Markwon
a26c13c93a0bccb828118b8df4266d8249993cd0
[ "Apache-2.0" ]
283
2017-08-29T03:57:17.000Z
2022-03-28T02:46:28.000Z
23.225352
74
0.624621
1,003,262
package io.noties.markwon.simple.ext; import androidx.annotation.NonNull; import org.commonmark.node.Node; import org.commonmark.node.Text; import org.commonmark.parser.delimiter.DelimiterProcessor; import org.commonmark.parser.delimiter.DelimiterRun; import io.noties.markwon.SpanFactory; // @since 4.0.0 class SimpleExtDelimiterProcessor implements DelimiterProcessor { private final char open; private final char close; private final int length; private final SpanFactory spanFactory; SimpleExtDelimiterProcessor( char open, char close, int length, @NonNull SpanFactory spanFactory) { this.open = open; this.close = close; this.length = length; this.spanFactory = spanFactory; } @Override public char getOpeningCharacter() { return open; } @Override public char getClosingCharacter() { return close; } @Override public int getMinLength() { return length; } @Override public int getDelimiterUse(DelimiterRun opener, DelimiterRun closer) { if (opener.length() >= length && closer.length() >= length) { return length; } return 0; } @Override public void process(Text opener, Text closer, int delimiterUse) { final Node node = new SimpleExtNode(spanFactory); Node tmp = opener.getNext(); Node next; while (tmp != null && tmp != closer) { next = tmp.getNext(); node.appendChild(tmp); tmp = next; } opener.insertAfter(node); } }
924526615bb7c1610a5ee115e72633fd0b3e7114
2,502
java
Java
src/main/java/de/beachboys/aoc2020/Day18.java
Torben2000/adventofcode2020
f2acbc20aaa56550e3ec5b20fc35c68e127b0d69
[ "MIT" ]
2
2021-12-16T16:35:22.000Z
2021-12-21T19:31:15.000Z
src/main/java/de/beachboys/aoc2020/Day18.java
Torben2000/adventofcode-java
f2acbc20aaa56550e3ec5b20fc35c68e127b0d69
[ "MIT" ]
null
null
null
src/main/java/de/beachboys/aoc2020/Day18.java
Torben2000/adventofcode-java
f2acbc20aaa56550e3ec5b20fc35c68e127b0d69
[ "MIT" ]
1
2020-12-12T10:13:35.000Z
2020-12-12T10:13:35.000Z
39.714286
192
0.609113
1,003,263
package de.beachboys.aoc2020; import de.beachboys.Day; import java.util.Arrays; import java.util.List; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Day18 extends Day { public Object part1(List<String> input) { long sum = 0L; for (String line : input) { sum += calculateLinePart1(line); } return sum; } private long calculateLinePart1(String line) { String currentLine = line; currentLine = applyPatternReplacementLogic(currentLine, "\\([^()]*\\)", match -> calculateLinePart1(match.substring(1, match.length() - 1)) + ""); currentLine = applyPatternReplacementLogic(currentLine, "^[0-9]+ [*+] [0-9]+", match -> { String[] c = match.split(" "); return "*".equals(c[1]) ? (Long.parseLong(c[0]) * Long.parseLong(c[2])) + "" : (Long.parseLong(c[0]) + Long.parseLong(c[2])) + ""; }); return Long.parseLong(currentLine); } public Object part2(List<String> input) { long sum = 0L; for (String line : input) { sum += calculateLinePart2(line); } return sum; } private long calculateLinePart2(String line) { String currentLine = line; currentLine = applyPatternReplacementLogic(currentLine, "\\([^()]*\\)", match -> calculateLinePart2(match.substring(1, match.length() - 1)) + ""); currentLine = applyPatternReplacementLogic(currentLine, "[0-9]+ \\+ [0-9]+", match -> Arrays.stream(match.split(" \\+ ")).mapToLong(Long::parseLong).sum() + ""); currentLine = applyPatternReplacementLogic(currentLine, "^[0-9]+ \\* [0-9]+", match -> Arrays.stream(match.split( " \\* ")).mapToLong(Long::parseLong).reduce(1, (a, b) -> a * b) + ""); return Long.parseLong(currentLine); } private String applyPatternReplacementLogic(String currentLine, String regex, Function<String, String> patternReplacement) { Pattern p = Pattern.compile(regex); boolean replacementHappened = true; while (replacementHappened) { replacementHappened = false; Matcher m = p.matcher(currentLine); while (m.find()) { replacementHappened = true; String substring = m.group(); currentLine = currentLine.replaceFirst(Pattern.quote(substring), patternReplacement.apply(substring)); } } return currentLine; } }
9245266663c941163fe0fb2b0a83e807ea8c66e1
6,486
java
Java
core/src/test/java/org/polypheny/db/test/catalog/Fixture.java
ppanopticon/Polypheny-DB
e76e0ad26634d6cd93fbbea187bbaac431f0bbea
[ "Apache-2.0" ]
75
2020-01-24T15:30:17.000Z
2022-03-30T02:01:13.000Z
core/src/test/java/org/polypheny/db/test/catalog/Fixture.java
ppanopticon/Polypheny-DB
e76e0ad26634d6cd93fbbea187bbaac431f0bbea
[ "Apache-2.0" ]
194
2019-12-06T19:24:48.000Z
2022-03-31T05:52:05.000Z
core/src/test/java/org/polypheny/db/test/catalog/Fixture.java
ppanopticon/Polypheny-DB
e76e0ad26634d6cd93fbbea187bbaac431f0bbea
[ "Apache-2.0" ]
44
2021-02-19T11:38:36.000Z
2022-03-31T06:11:54.000Z
44.731034
114
0.603608
1,003,264
/* * Copyright 2019-2020 The Polypheny 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file incorporates code covered by the following terms: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.polypheny.db.test.catalog; import java.util.Arrays; import org.polypheny.db.rel.type.RelDataType; import org.polypheny.db.rel.type.RelDataTypeComparability; import org.polypheny.db.rel.type.RelDataTypeFactory; import org.polypheny.db.rel.type.RelDataTypeFieldImpl; import org.polypheny.db.rel.type.StructKind; import org.polypheny.db.sql.SqlIdentifier; import org.polypheny.db.sql.parser.SqlParserPos; import org.polypheny.db.type.ObjectPolyType; import org.polypheny.db.type.PolyType; /** * Types used during initialization. */ final class Fixture { final RelDataType intType; final RelDataType intTypeNull; final RelDataType varchar10Type; final RelDataType varchar10TypeNull; final RelDataType varchar20Type; final RelDataType varchar20TypeNull; final RelDataType timestampType; final RelDataType timestampTypeNull; final RelDataType dateType; final RelDataType booleanType; final RelDataType booleanTypeNull; final RelDataType rectilinearCoordType; final RelDataType rectilinearPeekCoordType; final RelDataType rectilinearPeekNoExpandCoordType; final RelDataType abRecordType; final RelDataType skillRecordType; final RelDataType empRecordType; final RelDataType empListType; final ObjectPolyType addressType; Fixture( RelDataTypeFactory typeFactory ) { intType = typeFactory.createPolyType( PolyType.INTEGER ); intTypeNull = typeFactory.createTypeWithNullability( intType, true ); varchar10Type = typeFactory.createPolyType( PolyType.VARCHAR, 10 ); varchar10TypeNull = typeFactory.createTypeWithNullability( varchar10Type, true ); varchar20Type = typeFactory.createPolyType( PolyType.VARCHAR, 20 ); varchar20TypeNull = typeFactory.createTypeWithNullability( varchar20Type, true ); timestampType = typeFactory.createPolyType( PolyType.TIMESTAMP ); timestampTypeNull = typeFactory.createTypeWithNullability( timestampType, true ); dateType = typeFactory.createPolyType( PolyType.DATE ); booleanType = typeFactory.createPolyType( PolyType.BOOLEAN ); booleanTypeNull = typeFactory.createTypeWithNullability( booleanType, true ); rectilinearCoordType = typeFactory.builder() .add( "X", null, intType ) .add( "Y", null, intType ) .build(); rectilinearPeekCoordType = typeFactory.builder() .add( "X", null, intType ) .add( "Y", null, intType ) .kind( StructKind.PEEK_FIELDS ) .build(); rectilinearPeekNoExpandCoordType = typeFactory.builder() .add( "M", null, intType ) .add( "SUB", null, typeFactory.builder() .add( "A", null, intType ) .add( "B", null, intType ) .kind( StructKind.PEEK_FIELDS_NO_EXPAND ) .build() ) .kind( StructKind.PEEK_FIELDS_NO_EXPAND ) .build(); abRecordType = typeFactory.builder() .add( "A", null, varchar10Type ) .add( "B", null, varchar10Type ) .build(); skillRecordType = typeFactory.builder() .add( "TYPE", null, varchar10Type ) .add( "DESC", null, varchar20Type ) .add( "OTHERS", null, abRecordType ) .build(); empRecordType = typeFactory.builder() .add( "EMPNO", null, intType ) .add( "ENAME", null, varchar10Type ) .add( "DETAIL", null, typeFactory.builder() .add( "SKILLS", null, typeFactory.createArrayType( skillRecordType, -1 ) ) .build() ) .build(); empListType = typeFactory.createArrayType( empRecordType, -1 ); addressType = new ObjectPolyType( PolyType.STRUCTURED, new SqlIdentifier( "ADDRESS", SqlParserPos.ZERO ), false, Arrays.asList( new RelDataTypeFieldImpl( "STREET", 0, varchar20Type ), new RelDataTypeFieldImpl( "CITY", 1, varchar20Type ), new RelDataTypeFieldImpl( "ZIP", 2, intType ), new RelDataTypeFieldImpl( "STATE", 3, varchar20Type ) ), RelDataTypeComparability.NONE ); } }
924526cba13d0a670667434571a12277f2eedd33
1,360
java
Java
src/building/expressions/main/statements/ReturnStatement.java
xtay2/Pseudocode-II
0909bc347c836d7a0184f75066283f1f6165bb31
[ "Apache-2.0" ]
1
2022-02-23T20:10:57.000Z
2022-02-23T20:10:57.000Z
src/building/expressions/main/statements/ReturnStatement.java
xtay2/Pseudocode-II
0909bc347c836d7a0184f75066283f1f6165bb31
[ "Apache-2.0" ]
null
null
null
src/building/expressions/main/statements/ReturnStatement.java
xtay2/Pseudocode-II
0909bc347c836d7a0184f75066283f1f6165bb31
[ "Apache-2.0" ]
null
null
null
27.2
80
0.7375
1,003,265
package building.expressions.main.statements; import static building.types.specific.KeywordType.RETURN; import building.expressions.abstractions.MainExpression; import building.expressions.abstractions.interfaces.ValueHolder; import building.expressions.main.functions.Definition; import building.expressions.main.functions.Function; import interpreting.exceptions.IllegalCodeFormatException; import runtime.datatypes.Value; public class ReturnStatement extends MainExpression { private Definition myFunc = null; private final ValueHolder val; /** * Creates a {@link ReturnStatement}. * * @param val can be null. */ public ReturnStatement(int lineID, ValueHolder val) { super(lineID, RETURN); this.val = val; } /** Set the return-value of the function, and well... return. */ @Override public boolean execute() { if (val != null) { Value r = val.getValue(); myFunc.setValue(r); } return false; } /** Connect this {@link ReturnStatement} to a {@link Function}. */ public void initFunc(Definition def) { if (myFunc != null) throw new AssertionError("The function was already initialised."); if (def instanceof Function) myFunc = def; else if (val != null) { throw new IllegalCodeFormatException(getOriginalLine(), "Only return-statements that don't return values can be used in a " + def); } } }
924526f67afdd46c9880ba5e87f2b8355ee483b6
565
java
Java
core/src/main/java/com/huitai/core/file/dao/HtFileReceivedDao.java
314863336/jeemes-base
22ff034f12f4aefeab4dea0f18fb2f7d7b9942a9
[ "MIT" ]
null
null
null
core/src/main/java/com/huitai/core/file/dao/HtFileReceivedDao.java
314863336/jeemes-base
22ff034f12f4aefeab4dea0f18fb2f7d7b9942a9
[ "MIT" ]
null
null
null
core/src/main/java/com/huitai/core/file/dao/HtFileReceivedDao.java
314863336/jeemes-base
22ff034f12f4aefeab4dea0f18fb2f7d7b9942a9
[ "MIT" ]
null
null
null
21.730769
72
0.644248
1,003,266
package com.huitai.core.file.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.huitai.common.utils.Page; import com.huitai.core.file.entity.HtFileReceived; /** * <p> * 文档共享接收表 Mapper 接口 * </p> * * @author XJM * @since 2020-05-29 */ public interface HtFileReceivedDao extends BaseMapper<HtFileReceived> { /** * description: 获取分享给我文件列表 <br> * version: 1.0 <br> * date: 2020/5/28 15:45 <br> * author: XJM <br> */ Page<HtFileReceived> findToMeList(Page<HtFileReceived> page); }
92452706cb1119a597a0333ec9a0fcde859b9cd8
2,591
java
Java
src/main/java/rx/internal/operators/SingleOnSubscribeDelaySubscriptionOther.java
wangyingjie/MyRxJava
a37e292cfeb6c46559c397d730966d402b106fe5
[ "Apache-2.0" ]
2
2021-01-29T02:52:47.000Z
2021-08-20T15:53:31.000Z
src/main/java/rx/internal/operators/SingleOnSubscribeDelaySubscriptionOther.java
heroway/RxJava
d66d9313d8580b56a53b28dba32fb1ccacd606b6
[ "Apache-2.0" ]
1
2017-11-16T14:37:20.000Z
2017-11-16T14:37:20.000Z
src/main/java/rx/internal/operators/SingleOnSubscribeDelaySubscriptionOther.java
heroway/RxJava
d66d9313d8580b56a53b28dba32fb1ccacd606b6
[ "Apache-2.0" ]
1
2018-12-03T03:02:11.000Z
2018-12-03T03:02:11.000Z
28.788889
99
0.58819
1,003,267
/** * Copyright 2014 Netflix, Inc. * * 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 applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package rx.internal.operators; import rx.*; import rx.plugins.RxJavaHooks; import rx.subscriptions.SerialSubscription; /** * Delays the subscription to the Single until the Observable * fires an event or completes. * * @param <T> the Single value type */ public final class SingleOnSubscribeDelaySubscriptionOther<T> implements Single.OnSubscribe<T> { final Single<? extends T> main; final Observable<?> other; public SingleOnSubscribeDelaySubscriptionOther(Single<? extends T> main, Observable<?> other) { this.main = main; this.other = other; } @SuppressWarnings("unchecked") @Override public void call(final SingleSubscriber<? super T> subscriber) { final SingleSubscriber<T> child = new SingleSubscriber<T>() { @Override public void onSuccess(T value) { subscriber.onSuccess(value); } @Override public void onError(Throwable error) { subscriber.onError(error); } }; final SerialSubscription serial = new SerialSubscription(); subscriber.add(serial); Subscriber<Object> otherSubscriber = new Subscriber<Object>() { boolean done; @Override public void onNext(Object t) { onCompleted(); } @Override public void onError(Throwable e) { if (done) { RxJavaHooks.onError(e); return; } done = true; child.onError(e); } @Override public void onCompleted() { if (done) { return; } done = true; serial.set(child); main.subscribe(child); } }; serial.set(otherSubscriber); ((Observable<Object>)other).subscribe(otherSubscriber); } }
9245281eea6e65e0ecdace4106c9aa39f6aaf95c
2,137
java
Java
persistence/jpa/integration/src/main/java/org/apache/isis/persistence/jpa/integration/typeconverters/JavaAwtBufferedImageByteArrayConverter.java
ecpnv-devops/isis
aeda00974e293e2792783090360b155a9d1a6624
[ "Apache-2.0" ]
665
2015-01-01T06:06:28.000Z
2022-03-27T01:11:56.000Z
persistence/jpa/integration/src/main/java/org/apache/isis/persistence/jpa/integration/typeconverters/JavaAwtBufferedImageByteArrayConverter.java
jalexmelendez/isis
ddf3bd186cad585b959b7f20d8c9ac5e3f33263d
[ "Apache-2.0" ]
176
2015-02-07T11:29:36.000Z
2022-03-25T04:43:12.000Z
persistence/jpa/integration/src/main/java/org/apache/isis/persistence/jpa/integration/typeconverters/JavaAwtBufferedImageByteArrayConverter.java
jalexmelendez/isis
ddf3bd186cad585b959b7f20d8c9ac5e3f33263d
[ "Apache-2.0" ]
337
2015-01-02T03:01:34.000Z
2022-03-21T15:56:28.000Z
33.390625
87
0.688816
1,003,268
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.isis.persistence.jpa.integration.typeconverters; import java.awt.image.BufferedImage; import javax.persistence.AttributeConverter; import javax.persistence.Converter; import org.apache.isis.commons.internal.base._NullSafe; import org.apache.isis.commons.internal.image._Images; /** * @since 2.0 {@index} */ @Converter(autoApply = true) public class JavaAwtBufferedImageByteArrayConverter implements AttributeConverter<BufferedImage, byte[]> { @Override public byte[] convertToDatabaseColumn(BufferedImage memberValue) { if (memberValue == null) { return null; } try { return _Images.toBytes(memberValue); } catch (Exception e) { throw new javax.persistence.PersistenceException( "Error serialising object of type BufferedImage to byte array", e); } } @Override public BufferedImage convertToEntityAttribute(byte[] datastoreValue) { if (_NullSafe.size(datastoreValue) == 0) { return null; } try { return _Images.fromBytes(datastoreValue); } catch (Exception e) { throw new javax.persistence.PersistenceException( "Error deserialising image datastoreValue", e); } } }
924528b375cee184094282960b919426c65096e3
13,239
java
Java
TYT/app/src/main/java/com/qskj/tyt/fragment/T_MyFund_AccountGeneralFragment.java
jpaijh/TYT
458a45cf61582cf218eeeb4234c35b56ab587c00
[ "Apache-2.0" ]
3
2017-04-05T08:08:14.000Z
2018-08-30T06:43:44.000Z
TYT/app/src/main/java/com/qskj/tyt/fragment/T_MyFund_AccountGeneralFragment.java
jpaijh/TYT
458a45cf61582cf218eeeb4234c35b56ab587c00
[ "Apache-2.0" ]
null
null
null
TYT/app/src/main/java/com/qskj/tyt/fragment/T_MyFund_AccountGeneralFragment.java
jpaijh/TYT
458a45cf61582cf218eeeb4234c35b56ab587c00
[ "Apache-2.0" ]
null
null
null
40.118182
149
0.638341
1,003,270
package com.qskj.tyt.fragment; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.support.v4.content.LocalBroadcastManager; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.AppCompatTextView; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.Volley; import com.apkfuns.logutils.LogUtils; import com.qskj.tyt.AppDelegate; import com.qskj.tyt.MyAPI; import com.qskj.tyt.MyApplication_; import com.qskj.tyt.R; import com.qskj.tyt.activity.T_AccountFundDetailsActivity_; import com.qskj.tyt.entity.T_AccountFundDetailsEntity; import com.qskj.tyt.utils.StringUtil; import com.qskj.tyt.view.AlwaysMarqueeTextView; import org.androidannotations.annotations.EFragment; import org.androidannotations.annotations.ViewById; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; /** * 我的资金-普通账户界面 */ @EFragment(R.layout.swiperefreshlayout_recyclerview_tvnodata) public class T_MyFund_AccountGeneralFragment extends BaseFragment { private static final String TAG = "T_MyFund_AccountGeneralFragment"; private List<T_AccountFundDetailsEntity.RowsEntity> rowsEntityList; private MyAccountGeneralAdapter mAdapter; private LocalBroadcastManager mBroadcastManager; private BroadcastReceiver mReceiver; private int lastVisibleItem; private int totalPage; private int pageIndex = 1; private boolean isLoading; private boolean isFirstLoading; private LinearLayoutManager mLinearLayoutManager; private RequestQueue mRequestQueue; private String arguments = ""; private String keyword; @ViewById(R.id.swipe_refresh_layout) SwipeRefreshLayout mSwipeRefreshLayout; @ViewById(R.id.recyclerview) RecyclerView mRecyclerView; @ViewById(R.id.tv_no_data) AppCompatTextView tv_no_data; @Override public void onAfterViews() { mRequestQueue = Volley.newRequestQueue(getActivity()); initBroadcastReceiver(); initRecyclerView(); initSwipeRefreshLayout(); } /** * 注册广播接收者 */ private void initBroadcastReceiver() { mBroadcastManager = LocalBroadcastManager.getInstance(getActivity()); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(AppDelegate.ACTION_T_GENERAL_ACCOUNT_SEARCH); mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { arguments = intent.getStringExtra(AppDelegate.ACTION_T_ACCOUNT_SEARCH); keyword = intent.getStringExtra(AppDelegate.KEYWORD); mSwipeRefreshLayout.setRefreshing(true); isLoading = true; saveCurrentTime(TAG); pageIndex = 1; isFirstLoading = true; onBackgrounds(); } }; mBroadcastManager.registerReceiver(mReceiver, intentFilter); } private void initRecyclerView() { mLinearLayoutManager = new LinearLayoutManager(getActivity()); mRecyclerView.setLayoutManager(mLinearLayoutManager); mRecyclerView.setHasFixedSize(true); mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { if (mAdapter != null && newState == RecyclerView.SCROLL_STATE_IDLE && lastVisibleItem + 1 == mAdapter.getItemCount() && !isLoading) { mSwipeRefreshLayout.setRefreshing(true); isLoading = true; if (pageIndex < totalPage) { createLoadingSnackbar(mRecyclerView); pageIndex = pageIndex + 1; onBackgrounds(); } else { mSwipeRefreshLayout.setRefreshing(false); isLoading = false; createNoDateSnackbar(mRecyclerView); } super.onScrollStateChanged(recyclerView, newState); } } @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { lastVisibleItem = mLinearLayoutManager.findLastVisibleItemPosition(); super.onScrolled(recyclerView, dx, dy); } }); } private void initSwipeRefreshLayout() { mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { mSwipeRefreshLayout.setRefreshing(true); isLoading = true; saveCurrentTime(TAG); pageIndex = 1; isFirstLoading = true; onBackgrounds(); } }); mSwipeRefreshLayout.setColorSchemeResources(R.color.color_progress_1, R.color.color_progress_2); mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { pageIndex = 1; isFirstLoading = false; onBackgrounds(); createRefreshSnackbar(mRecyclerView, TAG); } }); } @Override public void onBackgrounds() { // 普通账户资金列表 type = 1 final String URL = MyAPI.getBaseUrl() + "/api/Funds/FundAccount/FindVFundDetiDetails?type=1&pageSize=10&pageIndex=" + pageIndex + "&accountId=" + MyApplication_.getInstance().getUserInfoSp().getString(AppDelegate.ACCOUNT_ID, "") + "&titleId=" + MyApplication_.getInstance().getUserInfoSp().getInt(AppDelegate.TITLE_ID, 0) + arguments; JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, URL, new Response.Listener<org.json.JSONObject>() { @Override public void onResponse(org.json.JSONObject response) { LogUtils.d("\n普通账户-URL:" + URL + "\n普通账户-RESPONSE:" + response.toString()); JSONObject jsonObject = JSON.parseObject(response.toString()); int total = jsonObject.getIntValue("total"); totalPage = jsonObject.getIntValue("totalPage"); if (keyword != null && !TextUtils.isEmpty(keyword) && total > 0) { saveKeyHistory(keyword); } if (total == 0) { hideView(mRecyclerView); showView(tv_no_data); } else { showView(mRecyclerView); hideView(tv_no_data); } if (total != 0 && pageIndex == 1) { JSONArray rows = jsonObject.getJSONArray("rows"); rowsEntityList = JSON.parseArray(rows.toString(), T_AccountFundDetailsEntity.RowsEntity.class); mAdapter = new MyAccountGeneralAdapter(rowsEntityList); mRecyclerView.setAdapter(mAdapter); if (!isFirstLoading) createRefreshCompleteSnackbar(mRecyclerView); } else if (pageIndex <= totalPage) { JSONArray rows = jsonObject.getJSONArray("rows"); rowsEntityList.addAll(lastVisibleItem + 1, JSON.parseArray(rows.toString(), T_AccountFundDetailsEntity.RowsEntity.class)); mAdapter.notifyDataSetChanged(); createLoadingCompleteSnackbar(mRecyclerView); } mSwipeRefreshLayout.setRefreshing(false); isLoading = false; } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { LogUtils.e("请求错误:" + error.toString()); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> map = new HashMap<>(); map.put(AppDelegate.QS_LOGIN, MyApplication_.getInstance().getUserInfoSp().getString(AppDelegate.LOGIN_NAME, "")); return map; } }; jsonObjectRequest.setTag(this); mRequestQueue.add(jsonObjectRequest); } /** * 将搜索有记录的 关键字 存起来(订单搜索界面 外销发票号 模糊搜索的历史记录) * * @param keyword */ private void saveKeyHistory(String keyword) { // 存入进行搜索过的关键字 SharedPreferences searchHistorySp = MyApplication_.getInstance().getSearchHistorySp(); Set<String> search_history = searchHistorySp.getStringSet(AppDelegate.HISTORY_SALE_INVOICE_ACCOUNT_SEARCH, null); if (search_history == null) { Set<String> newSet = new TreeSet<>(); newSet.add(keyword); searchHistorySp.edit().putStringSet(AppDelegate.HISTORY_SALE_INVOICE_ACCOUNT_SEARCH, newSet).commit(); } else { Set<String> sets = new TreeSet<>(); String[] strings = search_history.toArray(new String[]{}); for (int i = 0; i < strings.length; i++) { sets.add(strings[i]); } sets.add(keyword); searchHistorySp.edit().putStringSet(AppDelegate.HISTORY_SALE_INVOICE_ACCOUNT_SEARCH, sets).commit(); } } private class MyAccountGeneralAdapter extends RecyclerView.Adapter<MyAccountGeneralAdapter.ViewHolder> { private List<T_AccountFundDetailsEntity.RowsEntity> list; public MyAccountGeneralAdapter(List<T_AccountFundDetailsEntity.RowsEntity> list) { this.list = list; } @Override public int getItemCount() { return list.size(); } @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.t_item_account_list, viewGroup, false); return new ViewHolder(view); } public class ViewHolder extends RecyclerView.ViewHolder { public RelativeLayout rl_content; public AlwaysMarqueeTextView tv_relatedCompanyName; // 往来方 public AppCompatTextView tv_fundName; // 项目 public AppCompatTextView tv_amountRmb; // 收入/ 支出金额 public AppCompatTextView tv_createDate; // 时间 public ViewHolder(final View itemView) { super(itemView); tv_relatedCompanyName = (AlwaysMarqueeTextView) itemView.findViewById(R.id.tv_relatedCompanyName); tv_fundName = (AppCompatTextView) itemView.findViewById(R.id.tv_fundName); tv_amountRmb = (AppCompatTextView) itemView.findViewById(R.id.tv_amountRmb); tv_createDate = (AppCompatTextView) itemView.findViewById(R.id.tv_createDate); rl_content = (RelativeLayout) itemView.findViewById(R.id.rl_content); rl_content.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { T_AccountFundDetailsEntity.RowsEntity rowsEntity = list.get(getLayoutPosition()); T_AccountFundDetailsActivity_.intent(getActivity()).extra("rowsEntity", rowsEntity).start(); } }); } } @Override public void onBindViewHolder(ViewHolder viewHolder, int position) { T_AccountFundDetailsEntity.RowsEntity entity = list.get(position); viewHolder.tv_relatedCompanyName.setText(entity.getRelatedCompanyName()); viewHolder.tv_fundName.setText(entity.getFundName()); double amountRmb = entity.getAmountRmb(); if (amountRmb <= 0) { viewHolder.tv_amountRmb.setText(StringUtil.numberFormat(amountRmb)); viewHolder.tv_amountRmb.setTextColor(getColors(R.color.red_500)); } else { viewHolder.tv_amountRmb.setText("+" + StringUtil.numberFormat(amountRmb)); viewHolder.tv_amountRmb.setTextColor(getColors(R.color.green_300)); } viewHolder.tv_createDate.setText(StringUtil.dateRemoveT(entity.getCreateDate())); } } @Override public void onDestroyView() { mRequestQueue.cancelAll(this); mBroadcastManager.unregisterReceiver(mReceiver); super.onDestroyView(); } }
924528cf4305c7399e1ea5f4f54a6bb618057b30
307
java
Java
BPC-TIN/Jedla/src/cz/vutbr/feec/cviko4/Main.java
Oswinska/School-IBE
e113ae735d339ba2321dc929248bd6b4b20dc6b5
[ "MIT" ]
5
2021-09-28T20:12:09.000Z
2022-03-17T11:44:57.000Z
BPC-TIN/Jedla/src/cz/vutbr/feec/cviko4/Main.java
Oswinska/School-IBE
e113ae735d339ba2321dc929248bd6b4b20dc6b5
[ "MIT" ]
4
2020-11-03T22:38:17.000Z
2021-08-28T21:29:36.000Z
BPC-TIN/Jedla/src/cz/vutbr/feec/cviko4/Main.java
Oswinska/School-IBE
e113ae735d339ba2321dc929248bd6b4b20dc6b5
[ "MIT" ]
6
2021-08-28T21:32:43.000Z
2022-03-23T20:57:37.000Z
14.619048
41
0.651466
1,003,271
package cz.vutbr.feec.cviko4; public class Main { public static void main(String[] args) { ListOf list = new ListOf(); list.add2Start(5); list.add2Start(10); list.add2Start(8); list.include(10); list.include(11); list.include(8); list.removeFromStart(); list.include(8); } }
92452939ad382ed1b406a0b4349188f4035da69f
2,728
java
Java
core/runtime/android/runtime/src/main/java/org/hapjs/card/sdk/utils/CardThemeUtils.java
wangleyuan/hapjs
0c904ed7aed7b9004dca16fa772d9ecd4ca34ae4
[ "Apache-2.0" ]
54
2022-01-20T07:38:08.000Z
2022-03-24T06:31:55.000Z
core/runtime/android/runtime/src/main/java/org/hapjs/card/sdk/utils/CardThemeUtils.java
eggfly/hapjs
4c8a53bef25663c139d55beed29783cdfe936088
[ "Apache-2.0" ]
12
2022-01-20T09:31:28.000Z
2022-03-31T09:55:39.000Z
core/runtime/android/runtime/src/main/java/org/hapjs/card/sdk/utils/CardThemeUtils.java
eggfly/hapjs
4c8a53bef25663c139d55beed29783cdfe936088
[ "Apache-2.0" ]
20
2022-01-20T07:34:05.000Z
2022-03-30T06:18:00.000Z
34.974359
95
0.597874
1,003,272
/* * Copyright (c) 2021, the hapjs-platform Project Contributors * SPDX-License-Identifier: Apache-2.0 */ package org.hapjs.card.sdk.utils; import android.content.Context; import android.content.SharedPreferences; import android.text.TextUtils; import android.util.Log; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.json.JSONException; import org.json.JSONObject; public class CardThemeUtils { public static final String KEY_THEME = "theme"; private static final String TAG = "CardThemeUtils"; private static Map<String, ?> sThemes = new ConcurrentHashMap<>(); public static void initTheme(Context context) { sThemes.clear(); String name = KEY_THEME + "_" + context.getApplicationInfo().packageName; Map<String, ?> all = context.getSharedPreferences(name, Context.MODE_PRIVATE).getAll(); if (!all.isEmpty()) { sThemes = all; } else { Map<String, Object> map = new ConcurrentHashMap<>(); map.put("theme.titleTextColor", "#000000"); map.put("theme.textColor", "#000000"); map.put("theme.buttonTextColor", "#0971D4"); map.put("theme.buttonClickTextColor", "#4D0971D4"); map.put("theme.backgroundColor", "#00FFFFFF"); map.put("theme.borderTopRadius", "12px"); map.put("theme.borderBottomRadius", "12px"); map.put("theme.activeColor", "#4D000000"); sThemes = map; } } public static String getThemeValue(String key) { Object obj = sThemes.get(key); if (obj != null && obj instanceof String) { return (String) obj; } return null; } public static void setTheme(Context context, String theme) { if (TextUtils.isEmpty(theme)) { return; } try { String name = KEY_THEME + "_" + context.getApplicationInfo().packageName; SharedPreferences.Editor editor = context.getSharedPreferences(name, Context.MODE_PRIVATE).edit(); Map<String, Object> map = new HashMap<>(); JSONObject jsonObject = new JSONObject(theme); Iterator<String> keys = jsonObject.keys(); while (keys.hasNext()) { String key = keys.next(); String value = jsonObject.getString(key); editor.putString(key, value); map.put(key, value); } editor.apply(); sThemes.clear(); sThemes = map; } catch (JSONException e) { Log.e(TAG, "Fail to setTheme", e); } } }
924529c99e9f832b3e641f72a6870d2361824015
84,672
java
Java
core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
zinking/calcite
de3880298b180a38013c2a748758c863082ac272
[ "Apache-2.0" ]
10
2018-02-11T04:29:02.000Z
2021-10-09T05:21:11.000Z
core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
zinking/calcite
de3880298b180a38013c2a748758c863082ac272
[ "Apache-2.0" ]
7
2020-03-04T21:46:43.000Z
2022-01-27T16:19:20.000Z
core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
zinking/calcite
de3880298b180a38013c2a748758c863082ac272
[ "Apache-2.0" ]
8
2018-03-27T11:06:03.000Z
2021-12-09T07:38:42.000Z
34.758621
112
0.649152
1,003,273
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.calcite.plan; import org.apache.calcite.avatica.util.Spaces; import org.apache.calcite.linq4j.Ord; import org.apache.calcite.prepare.CalcitePrepareImpl; import org.apache.calcite.rel.RelCollation; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.SingleRel; import org.apache.calcite.rel.core.Aggregate; import org.apache.calcite.rel.core.AggregateCall; import org.apache.calcite.rel.core.Filter; import org.apache.calcite.rel.core.Join; import org.apache.calcite.rel.core.JoinRelType; import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.core.Sort; import org.apache.calcite.rel.core.TableScan; import org.apache.calcite.rel.core.Values; import org.apache.calcite.rel.logical.LogicalAggregate; import org.apache.calcite.rel.logical.LogicalFilter; import org.apache.calcite.rel.logical.LogicalJoin; import org.apache.calcite.rel.logical.LogicalProject; import org.apache.calcite.rel.logical.LogicalSort; import org.apache.calcite.rel.logical.LogicalUnion; import org.apache.calcite.rel.rules.ProjectRemoveRule; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexCall; import org.apache.calcite.rex.RexExecutorImpl; import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexLiteral; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexShuttle; import org.apache.calcite.rex.RexUtil; import org.apache.calcite.sql.SqlAggFunction; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.validate.SqlValidatorUtil; import org.apache.calcite.util.Bug; import org.apache.calcite.util.ControlFlowException; import org.apache.calcite.util.ImmutableBitSet; import org.apache.calcite.util.IntList; import org.apache.calcite.util.Pair; import org.apache.calcite.util.Util; import org.apache.calcite.util.mapping.Mapping; import org.apache.calcite.util.mapping.Mappings; import org.apache.calcite.util.trace.CalciteTrace; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Equivalence; import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import java.util.AbstractList; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import static org.apache.calcite.rex.RexUtil.andNot; import static org.apache.calcite.rex.RexUtil.removeAll; import static org.apache.calcite.rex.RexUtil.simplify; /** * Substitutes part of a tree of relational expressions with another tree. * * <p>The call {@code new SubstitutionVisitor(target, query).go(replacement))} * will return {@code query} with every occurrence of {@code target} replaced * by {@code replacement}.</p> * * <p>The following example shows how {@code SubstitutionVisitor} can be used * for materialized view recognition.</p> * * <ul> * <li>query = SELECT a, c FROM t WHERE x = 5 AND b = 4</li> * <li>target = SELECT a, b, c FROM t WHERE x = 5</li> * <li>replacement = SELECT * FROM mv</li> * <li>result = SELECT a, c FROM mv WHERE b = 4</li> * </ul> * * <p>Note that {@code result} uses the materialized view table {@code mv} and a * simplified condition {@code b = 4}.</p> * * <p>Uses a bottom-up matching algorithm. Nodes do not need to be identical. * At each level, returns the residue.</p> * * <p>The inputs must only include the core relational operators: * {@link org.apache.calcite.rel.logical.LogicalTableScan}, * {@link org.apache.calcite.rel.logical.LogicalFilter}, * {@link org.apache.calcite.rel.logical.LogicalProject}, * {@link org.apache.calcite.rel.logical.LogicalJoin}, * {@link org.apache.calcite.rel.logical.LogicalUnion}, * {@link org.apache.calcite.rel.logical.LogicalAggregate}.</p> */ public class SubstitutionVisitor { private static final boolean DEBUG = CalcitePrepareImpl.DEBUG; private static final Logger LOGGER = CalciteTrace.getPlannerTracer(); /** Equivalence that compares objects by their {@link Object#toString()} * method. */ private static final Equivalence<Object> STRING_EQUIVALENCE = new Equivalence<Object>() { @Override protected boolean doEquivalent(Object o, Object o2) { return o.toString().equals(o2.toString()); } @Override protected int doHash(Object o) { return o.toString().hashCode(); } }; /** Equivalence that compares {@link Lists}s by the * {@link Object#toString()} of their elements. */ @SuppressWarnings("unchecked") private static final Equivalence<List<?>> PAIRWISE_STRING_EQUIVALENCE = (Equivalence) STRING_EQUIVALENCE.pairwise(); protected static final ImmutableList<UnifyRule> DEFAULT_RULES = ImmutableList.<UnifyRule>of( // TrivialRule.INSTANCE, ScanToProjectUnifyRule.INSTANCE, ProjectToProjectUnifyRule.INSTANCE, FilterToProjectUnifyRule.INSTANCE, // ProjectToFilterUnifyRule.INSTANCE, FilterToFilterUnifyRule.INSTANCE, AggregateToAggregateUnifyRule.INSTANCE, AggregateOnProjectToAggregateUnifyRule.INSTANCE); private final ImmutableList<UnifyRule> rules; private final Map<Pair<Class, Class>, List<UnifyRule>> ruleMap = new HashMap<>(); private final RelOptCluster cluster; private final Holder query; private final MutableRel target; /** * Nodes in {@link #target} that have no children. */ final List<MutableRel> targetLeaves; /** * Nodes in {@link #query} that have no children. */ final List<MutableRel> queryLeaves; final Map<MutableRel, MutableRel> replacementMap = new HashMap<>(); final Multimap<MutableRel, MutableRel> equivalents = LinkedHashMultimap.create(); /** Workspace while rule is being matched. * Careful, re-entrant! * Assumes no rule needs more than 2 slots. */ protected final MutableRel[] slots = new MutableRel[2]; /** Creates a SubstitutionVisitor with the default rule set. */ public SubstitutionVisitor(RelNode target_, RelNode query_) { this(target_, query_, DEFAULT_RULES); } /** Creates a SubstitutionVisitor. */ public SubstitutionVisitor(RelNode target_, RelNode query_, ImmutableList<UnifyRule> rules) { this.cluster = target_.getCluster(); this.rules = rules; this.query = Holder.of(toMutable(query_)); this.target = toMutable(target_); final Set<MutableRel> parents = Sets.newIdentityHashSet(); final List<MutableRel> allNodes = new ArrayList<>(); final MutableRelVisitor visitor = new MutableRelVisitor() { public void visit(MutableRel node) { parents.add(node.parent); allNodes.add(node); super.visit(node); } }; visitor.go(target); // Populate the list of leaves in the tree under "target". // Leaves are all nodes that are not parents. // For determinism, it is important that the list is in scan order. allNodes.removeAll(parents); targetLeaves = ImmutableList.copyOf(allNodes); allNodes.clear(); parents.clear(); visitor.go(query); allNodes.removeAll(parents); queryLeaves = ImmutableList.copyOf(allNodes); } private static MutableRel toMutable(RelNode rel) { if (rel instanceof TableScan) { return MutableScan.of((TableScan) rel); } if (rel instanceof Values) { return MutableValues.of((Values) rel); } if (rel instanceof Project) { final Project project = (Project) rel; final MutableRel input = toMutable(project.getInput()); return MutableProject.of(input, project.getProjects(), project.getRowType().getFieldNames()); } if (rel instanceof Filter) { final Filter filter = (Filter) rel; final MutableRel input = toMutable(filter.getInput()); return MutableFilter.of(input, filter.getCondition()); } if (rel instanceof Aggregate) { final Aggregate aggregate = (Aggregate) rel; final MutableRel input = toMutable(aggregate.getInput()); return MutableAggregate.of(input, aggregate.indicator, aggregate.getGroupSet(), aggregate.getGroupSets(), aggregate.getAggCallList()); } if (rel instanceof Join) { final Join join = (Join) rel; final MutableRel left = toMutable(join.getLeft()); final MutableRel right = toMutable(join.getRight()); return MutableJoin.of(join.getCluster(), left, right, join.getCondition(), join.getJoinType(), join.getVariablesStopped()); } if (rel instanceof Sort) { final Sort sort = (Sort) rel; final MutableRel input = toMutable(sort.getInput()); return MutableSort.of(input, sort.getCollation(), sort.offset, sort.fetch); } throw new RuntimeException("cannot translate " + rel + " to MutableRel"); } void register(MutableRel result, MutableRel query) { } /** * Maps a condition onto a target. * * <p>If condition is stronger than target, returns the residue. * If it is equal to target, returns the expression that evaluates to * the constant {@code true}. If it is weaker than target, returns * {@code null}.</p> * * <p>The terms satisfy the relation</p> * * <pre> * {@code condition = target AND residue} * </pre> * * <p>and {@code residue} must be as weak as possible.</p> * * <p>Example #1: condition stronger than target</p> * <ul> * <li>condition: x = 1 AND y = 2</li> * <li>target: x = 1</li> * <li>residue: y = 2</li> * </ul> * * <p>Note that residue {@code x &gt; 0 AND y = 2} would also satisfy the * relation {@code condition = target AND residue} but is stronger than * necessary, so we prefer {@code y = 2}.</p> * * <p>Example #2: target weaker than condition (valid, but not currently * implemented)</p> * <ul> * <li>condition: x = 1</li> * <li>target: x = 1 OR z = 3</li> * <li>residue: NOT (z = 3)</li> * </ul> * * <p>Example #3: condition and target are equivalent</p> * <ul> * <li>condition: x = 1 AND y = 2</li> * <li>target: y = 2 AND x = 1</li> * <li>residue: TRUE</li> * </ul> * * <p>Example #4: condition weaker than target</p> * <ul> * <li>condition: x = 1</li> * <li>target: x = 1 AND y = 2</li> * <li>residue: null (i.e. no match)</li> * </ul> * * <p>There are many other possible examples. It amounts to solving * whether {@code condition AND NOT target} can ever evaluate to * true, and therefore is a form of the NP-complete * <a href="http://en.wikipedia.org/wiki/Satisfiability">Satisfiability</a> * problem.</p> */ @VisibleForTesting public static RexNode splitFilter( final RexBuilder rexBuilder, RexNode condition, RexNode target) { // First, try splitting into ORs. // Given target c1 OR c2 OR c3 OR c4 // and condition c2 OR c4 // residue is NOT c1 AND NOT c3 // Also deals with case target [x] condition [x] yields residue [true]. RexNode z = splitOr(rexBuilder, condition, target); if (z != null) { return z; } RexNode x = andNot(rexBuilder, target, condition); if (mayBeSatisfiable(x)) { RexNode x2 = andNot(rexBuilder, condition, target); return simplify(rexBuilder, x2); } return null; } private static RexNode splitOr( final RexBuilder rexBuilder, RexNode condition, RexNode target) { List<RexNode> targets = RelOptUtil.disjunctions(target); for (RexNode e : RelOptUtil.disjunctions(condition)) { boolean found = removeAll(targets, e); if (!found) { return null; } } return RexUtil.composeConjunction(rexBuilder, Lists.transform(targets, RexUtil.notFn(rexBuilder)), false); } /** * Returns whether a boolean expression ever returns true. * * <p>This method may give false positives. For instance, it will say * that {@code x = 5 AND x > 10} is satisfiable, because at present it * cannot prove that it is not.</p> */ public static boolean mayBeSatisfiable(RexNode e) { // Example: // e: x = 1 AND y = 2 AND z = 3 AND NOT (x = 1 AND y = 2) // disjunctions: {x = 1, y = 2, z = 3} // notDisjunctions: {x = 1 AND y = 2} final List<RexNode> disjunctions = new ArrayList<>(); final List<RexNode> notDisjunctions = new ArrayList<>(); RelOptUtil.decomposeConjunction(e, disjunctions, notDisjunctions); // If there is a single FALSE or NOT TRUE, the whole expression is // always false. for (RexNode disjunction : disjunctions) { switch (disjunction.getKind()) { case LITERAL: if (!RexLiteral.booleanValue(disjunction)) { return false; } } } for (RexNode disjunction : notDisjunctions) { switch (disjunction.getKind()) { case LITERAL: if (RexLiteral.booleanValue(disjunction)) { return false; } } } // If one of the not-disjunctions is a disjunction that is wholly // contained in the disjunctions list, the expression is not // satisfiable. // // Example #1. x AND y AND z AND NOT (x AND y) - not satisfiable // Example #2. x AND y AND NOT (x AND y) - not satisfiable // Example #3. x AND y AND NOT (x AND y AND z) - may be satisfiable for (RexNode notDisjunction : notDisjunctions) { final List<RexNode> disjunctions2 = RelOptUtil.conjunctions(notDisjunction); if (disjunctions.containsAll(disjunctions2)) { return false; } } return true; } public RelNode go0(RelNode replacement_) { assert false; // not called MutableRel replacement = toMutable(replacement_); assert MutableRels.equalType( "target", target, "replacement", replacement, true); replacementMap.put(target, replacement); final UnifyResult unifyResult = matchRecurse(target); if (unifyResult == null) { return null; } final MutableRel node0 = unifyResult.result; MutableRel node = node0; // replaceAncestors(node0); if (DEBUG) { System.out.println("Convert: query:\n" + query.deep() + "\nunify.query:\n" + unifyResult.call.query.deep() + "\nunify.result:\n" + unifyResult.result.deep() + "\nunify.target:\n" + unifyResult.call.target.deep() + "\nnode0:\n" + node0.deep() + "\nnode:\n" + node.deep()); } return fromMutable(node); } /** * Returns a list of all possible rels that result from substituting the * matched RelNode with the replacement RelNode within the query. * * <p>For example, the substitution result of A join B, while A and B * are both a qualified match for replacement R, is R join B, R join R, * A join R. */ public List<RelNode> go(RelNode replacement_) { List<List<Replacement>> matches = go(toMutable(replacement_)); if (matches.isEmpty()) { return ImmutableList.of(); } List<RelNode> sub = Lists.newArrayList(); sub.add(fromMutable(query.input)); reverseSubstitute(query, matches, sub, 0, matches.size()); return sub; } /** * Substitutes the query with replacement whenever possible but meanwhile * keeps track of all the substitutions and their original rel before * replacement, so that in later processing stage, the replacement can be * recovered individually to produce a list of all possible rels with * substitution in different places. */ private List<List<Replacement>> go(MutableRel replacement) { assert MutableRels.equalType( "target", target, "replacement", replacement, true); final List<MutableRel> queryDescendants = MutableRels.descendants(query); final List<MutableRel> targetDescendants = MutableRels.descendants(target); // Populate "equivalents" with (q, t) for each query descendant q and // target descendant t that are equal. final Map<MutableRel, MutableRel> map = Maps.newHashMap(); for (MutableRel queryDescendant : queryDescendants) { map.put(queryDescendant, queryDescendant); } for (MutableRel targetDescendant : targetDescendants) { MutableRel queryDescendant = map.get(targetDescendant); if (queryDescendant != null) { assert queryDescendant.rowType.equals(targetDescendant.rowType); equivalents.put(queryDescendant, targetDescendant); } } map.clear(); final List<Replacement> attempted = Lists.newArrayList(); List<List<Replacement>> substitutions = Lists.newArrayList(); for (;;) { int count = 0; MutableRel queryDescendant = query; outer: while (queryDescendant != null) { for (Replacement r : attempted) { if (queryDescendant == r.after) { // This node has been replaced by previous iterations in the // hope to match its ancestors, so the node itself should not // be matched again. queryDescendant = MutableRels.preOrderTraverseNext(queryDescendant); continue outer; } } final MutableRel next = MutableRels.preOrderTraverseNext(queryDescendant); final MutableRel childOrNext = queryDescendant.getInputs().isEmpty() ? next : queryDescendant.getInputs().get(0); for (MutableRel targetDescendant : targetDescendants) { for (UnifyRule rule : applicableRules(queryDescendant, targetDescendant)) { UnifyRuleCall call = rule.match(this, queryDescendant, targetDescendant); if (call != null) { final UnifyResult result = rule.apply(call); if (result != null) { ++count; attempted.add(new Replacement(result.call.query, result.result)); MutableRel parent = result.call.query.replaceInParent(result.result); // Replace previous equivalents with new equivalents, higher up // the tree. for (int i = 0; i < rule.slotCount; i++) { equivalents.removeAll(slots[i]); } assert result.result.rowType.equals(result.call.query.rowType) : Pair.of(result.result, result.call.query); equivalents.put(result.result, result.call.query); if (targetDescendant == target) { // A real substitution happens. We purge the attempted // replacement list and add them into substitution list. // Meanwhile we stop matching the descendants and jump // to the next subtree in pre-order traversal. if (!target.equals(replacement)) { Replacement r = MutableRels.replace( query.input, target, copyMutable(replacement)); assert r != null : rule + "should have returned a result containing the target."; attempted.add(r); } substitutions.add(ImmutableList.copyOf(attempted)); attempted.clear(); queryDescendant = next; continue outer; } // We will try walking the query tree all over again to see // if there can be any substitutions after the replacement // attempt. break outer; } } } } queryDescendant = childOrNext; } // Quit the entire loop if: // 1) we have walked the entire query tree with one or more successful // substitutions, thus count != 0 && attempted.isEmpty(); // 2) we have walked the entire query tree but have made no replacement // attempt, thus count == 0 && attempted.isEmpty(); // 3) we had done some replacement attempt in a previous walk, but in // this one we have not found any potential matches or substitutions, // thus count == 0 && !attempted.isEmpty(). if (count == 0 || attempted.isEmpty()) { break; } } if (!attempted.isEmpty()) { // We had done some replacement attempt in the previous walk, but that // did not lead to any substitutions in this walk, so we need to recover // the replacement. undoReplacement(attempted); } return substitutions; } /** * Represents a replacement action: before => after. */ private static class Replacement { final MutableRel before; final MutableRel after; Replacement(MutableRel before, MutableRel after) { this.before = before; this.after = after; } } private static void undoReplacement(List<Replacement> replacement) { for (int i = replacement.size() - 1; i >= 0; i--) { Replacement r = replacement.get(i); r.after.replaceInParent(r.before); } } private static void redoReplacement(List<Replacement> replacement) { for (Replacement r : replacement) { r.before.replaceInParent(r.after); } } private static void reverseSubstitute(Holder query, List<List<Replacement>> matches, List<RelNode> sub, int replaceCount, int maxCount) { if (matches.isEmpty()) { return; } final List<List<Replacement>> rem = matches.subList(1, matches.size()); reverseSubstitute(query, rem, sub, replaceCount, maxCount); undoReplacement(matches.get(0)); if (++replaceCount < maxCount) { sub.add(fromMutable(query.input)); } reverseSubstitute(query, rem, sub, replaceCount, maxCount); redoReplacement(matches.get(0)); } private static List<RelNode> fromMutables(List<MutableRel> nodes) { return Lists.transform(nodes, new Function<MutableRel, RelNode>() { public RelNode apply(MutableRel mutableRel) { return fromMutable(mutableRel); } }); } private static RelNode fromMutable(MutableRel node) { switch (node.type) { case SCAN: case VALUES: return ((MutableLeafRel) node).rel; case PROJECT: final MutableProject project = (MutableProject) node; return LogicalProject.create(fromMutable(project.input), project.projects, project.rowType); case FILTER: final MutableFilter filter = (MutableFilter) node; return LogicalFilter.create(fromMutable(filter.input), filter.condition); case AGGREGATE: final MutableAggregate aggregate = (MutableAggregate) node; return LogicalAggregate.create(fromMutable(aggregate.input), aggregate.indicator, aggregate.groupSet, aggregate.groupSets, aggregate.aggCalls); case SORT: final MutableSort sort = (MutableSort) node; return LogicalSort.create(fromMutable(sort.input), sort.collation, sort.offset, sort.fetch); case UNION: final MutableUnion union = (MutableUnion) node; return LogicalUnion.create(fromMutables(union.inputs), union.all); case JOIN: final MutableJoin join = (MutableJoin) node; return LogicalJoin.create(fromMutable(join.getLeft()), fromMutable(join.getRight()), join.getCondition(), join.getJoinType(), join.getVariablesStopped()); default: throw new AssertionError(node.deep()); } } private static List<MutableRel> copyMutables(List<MutableRel> nodes) { return Lists.transform(nodes, new Function<MutableRel, MutableRel>() { public MutableRel apply(MutableRel mutableRel) { return copyMutable(mutableRel); } }); } private static MutableRel copyMutable(MutableRel node) { switch (node.type) { case SCAN: return MutableScan.of((TableScan) ((MutableScan) node).rel); case VALUES: return MutableValues.of((Values) ((MutableValues) node).rel); case PROJECT: final MutableProject project = (MutableProject) node; return MutableProject.of(project.rowType, copyMutable(project.input), project.projects); case FILTER: final MutableFilter filter = (MutableFilter) node; return MutableFilter.of(copyMutable(filter.input), filter.condition); case AGGREGATE: final MutableAggregate aggregate = (MutableAggregate) node; return MutableAggregate.of(copyMutable(aggregate.input), aggregate.indicator, aggregate.groupSet, aggregate.groupSets, aggregate.aggCalls); case SORT: final MutableSort sort = (MutableSort) node; return MutableSort.of(copyMutable(sort.input), sort.collation, sort.offset, sort.fetch); case UNION: final MutableUnion union = (MutableUnion) node; return MutableUnion.of(copyMutables(union.inputs), union.all); case JOIN: final MutableJoin join = (MutableJoin) node; return MutableJoin.of(join.cluster, copyMutable(join.getLeft()), copyMutable(join.getRight()), join.getCondition(), join.getJoinType(), join.getVariablesStopped()); default: throw new AssertionError(node.deep()); } } private UnifyResult matchRecurse(MutableRel target) { assert false; // not called final List<MutableRel> targetInputs = target.getInputs(); MutableRel queryParent = null; for (MutableRel targetInput : targetInputs) { UnifyResult unifyResult = matchRecurse(targetInput); if (unifyResult == null) { return null; } queryParent = unifyResult.call.query.replaceInParent(unifyResult.result); } if (targetInputs.isEmpty()) { for (MutableRel queryLeaf : queryLeaves) { for (UnifyRule rule : applicableRules(queryLeaf, target)) { final UnifyResult x = apply(rule, queryLeaf, target); if (x != null) { if (DEBUG) { System.out.println("Rule: " + rule + "\nQuery:\n" + queryParent + (x.call.query != queryParent ? "\nQuery (original):\n" + queryParent : "") + "\nTarget:\n" + target.deep() + "\nResult:\n" + x.result.deep() + "\n"); } return x; } } } } else { assert queryParent != null; for (UnifyRule rule : applicableRules(queryParent, target)) { final UnifyResult x = apply(rule, queryParent, target); if (x != null) { if (DEBUG) { System.out.println( "Rule: " + rule + "\nQuery:\n" + queryParent.deep() + (x.call.query != queryParent ? "\nQuery (original):\n" + queryParent.toString() : "") + "\nTarget:\n" + target.deep() + "\nResult:\n" + x.result.deep() + "\n"); } return x; } } } if (DEBUG) { System.out.println( "Unify failed:" + "\nQuery:\n" + queryParent.toString() + "\nTarget:\n" + target.toString() + "\n"); } return null; } private UnifyResult apply(UnifyRule rule, MutableRel query, MutableRel target) { final UnifyRuleCall call = new UnifyRuleCall(rule, query, target, null); return rule.apply(call); } private List<UnifyRule> applicableRules(MutableRel query, MutableRel target) { final Class queryClass = query.getClass(); final Class targetClass = target.getClass(); final Pair<Class, Class> key = Pair.of(queryClass, targetClass); List<UnifyRule> list = ruleMap.get(key); if (list == null) { final ImmutableList.Builder<UnifyRule> builder = ImmutableList.builder(); for (UnifyRule rule : rules) { //noinspection unchecked if (mightMatch(rule, queryClass, targetClass)) { builder.add(rule); } } list = builder.build(); ruleMap.put(key, list); } return list; } private static boolean mightMatch(UnifyRule rule, Class queryClass, Class targetClass) { return rule.queryOperand.clazz.isAssignableFrom(queryClass) && rule.targetOperand.clazz.isAssignableFrom(targetClass); } /** Exception thrown to exit a matcher. Not really an error. */ protected static class MatchFailed extends ControlFlowException { @SuppressWarnings("ThrowableInstanceNeverThrown") public static final MatchFailed INSTANCE = new MatchFailed(); } /** Rule that attempts to match a query relational expression * against a target relational expression. * * <p>The rule declares the query and target types; this allows the * engine to fire only a few rules in a given context.</p> */ protected abstract static class UnifyRule { protected final int slotCount; protected final Operand queryOperand; protected final Operand targetOperand; protected UnifyRule(int slotCount, Operand queryOperand, Operand targetOperand) { this.slotCount = slotCount; this.queryOperand = queryOperand; this.targetOperand = targetOperand; } /** * <p>Applies this rule to a particular node in a query. The goal is * to convert {@code query} into {@code target}. Before the rule is * invoked, Calcite has made sure that query's children are equivalent * to target's children. * * <p>There are 3 possible outcomes:</p> * * <ul> * * <li>{@code query} already exactly matches {@code target}; returns * {@code target}</li> * * <li>{@code query} is sufficiently close to a match for * {@code target}; returns {@code target}</li> * * <li>{@code query} cannot be made to match {@code target}; returns * null</li> * * </ul> * * <p>REVIEW: Is possible that we match query PLUS one or more of its * ancestors?</p> * * @param call Input parameters */ protected abstract UnifyResult apply(UnifyRuleCall call); protected UnifyRuleCall match(SubstitutionVisitor visitor, MutableRel query, MutableRel target) { if (queryOperand.matches(visitor, query)) { if (targetOperand.matches(visitor, target)) { return visitor.new UnifyRuleCall(this, query, target, copy(visitor.slots, slotCount)); } } return null; } protected <E> ImmutableList<E> copy(E[] slots, int slotCount) { // Optimize if there are 0 or 1 slots. switch (slotCount) { case 0: return ImmutableList.of(); case 1: return ImmutableList.of(slots[0]); default: return ImmutableList.copyOf(slots).subList(0, slotCount); } } } /** * Arguments to an application of a {@link UnifyRule}. */ protected class UnifyRuleCall { protected final UnifyRule rule; public final MutableRel query; public final MutableRel target; protected final ImmutableList<MutableRel> slots; public UnifyRuleCall(UnifyRule rule, MutableRel query, MutableRel target, ImmutableList<MutableRel> slots) { this.rule = Preconditions.checkNotNull(rule); this.query = Preconditions.checkNotNull(query); this.target = Preconditions.checkNotNull(target); this.slots = Preconditions.checkNotNull(slots); } public UnifyResult result(MutableRel result) { assert MutableRels.contains(result, target); assert MutableRels.equalType("result", result, "query", query, true); MutableRel replace = replacementMap.get(target); if (replace != null) { assert false; // replacementMap is always empty // result = MutableRels.replace(result, target, replace); } register(result, query); return new UnifyResult(this, result); } /** * Creates a {@link UnifyRuleCall} based on the parent of {@code query}. */ public UnifyRuleCall create(MutableRel query) { return new UnifyRuleCall(rule, query, target, slots); } public RelOptCluster getCluster() { return cluster; } } /** * Result of an application of a {@link UnifyRule} indicating that the * rule successfully matched {@code query} against {@code target} and * generated a {@code result} that is equivalent to {@code query} and * contains {@code target}. */ protected static class UnifyResult { private final UnifyRuleCall call; // equivalent to "query", contains "result" private final MutableRel result; UnifyResult(UnifyRuleCall call, MutableRel result) { this.call = call; assert MutableRels.equalType("query", call.query, "result", result, true); this.result = result; } } /** Abstract base class for implementing {@link UnifyRule}. */ protected abstract static class AbstractUnifyRule extends UnifyRule { public AbstractUnifyRule(Operand queryOperand, Operand targetOperand, int slotCount) { super(slotCount, queryOperand, targetOperand); //noinspection AssertWithSideEffects assert isValid(); } protected boolean isValid() { final SlotCounter slotCounter = new SlotCounter(); slotCounter.visit(queryOperand); assert slotCounter.queryCount == slotCount; assert slotCounter.targetCount == 0; slotCounter.queryCount = 0; slotCounter.visit(targetOperand); assert slotCounter.queryCount == 0; assert slotCounter.targetCount == slotCount; return true; } /** Creates an operand with given inputs. */ protected static Operand operand(Class<? extends MutableRel> clazz, Operand... inputOperands) { return new InternalOperand(clazz, ImmutableList.copyOf(inputOperands)); } /** Creates an operand that doesn't check inputs. */ protected static Operand any(Class<? extends MutableRel> clazz) { return new AnyOperand(clazz); } /** Creates an operand that matches a relational expression in the query. */ protected static Operand query(int ordinal) { return new QueryOperand(ordinal); } /** Creates an operand that matches a relational expression in the * target. */ protected static Operand target(int ordinal) { return new TargetOperand(ordinal); } } /** Implementation of {@link UnifyRule} that matches if the query is already * equal to the target. * * <p>Matches scans to the same table, because these will be * {@link MutableScan}s with the same * {@link org.apache.calcite.rel.logical.LogicalTableScan} instance.</p> */ private static class TrivialRule extends AbstractUnifyRule { private static final TrivialRule INSTANCE = new TrivialRule(); private TrivialRule() { super(any(MutableRel.class), any(MutableRel.class), 0); } public UnifyResult apply(UnifyRuleCall call) { if (call.query.equals(call.target)) { return call.result(call.query); } return null; } } /** Implementation of {@link UnifyRule} that matches * {@link org.apache.calcite.rel.logical.LogicalTableScan}. */ private static class ScanToProjectUnifyRule extends AbstractUnifyRule { public static final ScanToProjectUnifyRule INSTANCE = new ScanToProjectUnifyRule(); private ScanToProjectUnifyRule() { super(any(MutableScan.class), any(MutableProject.class), 0); } public UnifyResult apply(UnifyRuleCall call) { final MutableProject target = (MutableProject) call.target; final MutableScan query = (MutableScan) call.query; // We do not need to check query's parent type to avoid duplication // of ProjectToProjectUnifyRule or FilterToProjectUnifyRule, since // SubstitutionVisitor performs a top-down match. if (!query.equals(target.getInput())) { return null; } final RexShuttle shuttle = getRexShuttle(target); final RexBuilder rexBuilder = target.cluster.getRexBuilder(); final List<RexNode> newProjects; try { newProjects = (List<RexNode>) shuttle.apply(rexBuilder.identityProjects(query.getRowType())); } catch (MatchFailed e) { return null; } final MutableProject newProject = MutableProject.of( query.getRowType(), target, newProjects); final MutableRel newProject2 = MutableRels.strip(newProject); return call.result(newProject2); } } /** Implementation of {@link UnifyRule} that matches * {@link org.apache.calcite.rel.logical.LogicalProject}. */ private static class ProjectToProjectUnifyRule extends AbstractUnifyRule { public static final ProjectToProjectUnifyRule INSTANCE = new ProjectToProjectUnifyRule(); private ProjectToProjectUnifyRule() { super(operand(MutableProject.class, query(0)), operand(MutableProject.class, target(0)), 1); } public UnifyResult apply(UnifyRuleCall call) { final MutableProject target = (MutableProject) call.target; final MutableProject query = (MutableProject) call.query; final RexShuttle shuttle = getRexShuttle(target); final List<RexNode> newProjects; try { newProjects = shuttle.apply(query.getProjects()); } catch (MatchFailed e) { return null; } final MutableProject newProject = MutableProject.of( query.getRowType(), target, newProjects); final MutableRel newProject2 = MutableRels.strip(newProject); return call.result(newProject2); } } /** Implementation of {@link UnifyRule} that matches a {@link MutableFilter} * to a {@link MutableProject}. */ private static class FilterToProjectUnifyRule extends AbstractUnifyRule { public static final FilterToProjectUnifyRule INSTANCE = new FilterToProjectUnifyRule(); private FilterToProjectUnifyRule() { super(operand(MutableFilter.class, query(0)), operand(MutableProject.class, target(0)), 1); } public UnifyResult apply(UnifyRuleCall call) { // Child of projectTarget is equivalent to child of filterQuery. try { // TODO: make sure that constants are ok final MutableProject target = (MutableProject) call.target; final RexShuttle shuttle = getRexShuttle(target); final RexNode newCondition; final MutableFilter query = (MutableFilter) call.query; try { newCondition = query.getCondition().accept(shuttle); } catch (MatchFailed e) { return null; } final MutableFilter newFilter = MutableFilter.of(target, newCondition); if (query.parent instanceof MutableProject) { final MutableRel inverse = invert(((MutableProject) query.parent).getNamedProjects(), newFilter, shuttle); return call.create(query.parent).result(inverse); } else { final MutableRel inverse = invert(query, newFilter, target); return call.result(inverse); } } catch (MatchFailed e) { return null; } } protected MutableRel invert(List<Pair<RexNode, String>> namedProjects, MutableRel input, RexShuttle shuttle) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("SubstitutionVisitor: invert:\n" + "projects: " + namedProjects + "\n" + "input: " + input + "\n" + "project: " + shuttle + "\n"); } final List<RexNode> exprList = new ArrayList<>(); final RexBuilder rexBuilder = input.cluster.getRexBuilder(); final List<RexNode> projects = Pair.left(namedProjects); for (RexNode expr : projects) { exprList.add(rexBuilder.makeZeroLiteral(expr.getType())); } for (Ord<RexNode> expr : Ord.zip(projects)) { final RexNode node = expr.e.accept(shuttle); if (node == null) { throw MatchFailed.INSTANCE; } exprList.set(expr.i, node); } return MutableProject.of(input, exprList, Pair.right(namedProjects)); } protected MutableRel invert(MutableRel model, MutableRel input, MutableProject project) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("SubstitutionVisitor: invert:\n" + "model: " + model + "\n" + "input: " + input + "\n" + "project: " + project + "\n"); } final List<RexNode> exprList = new ArrayList<>(); final RexBuilder rexBuilder = model.cluster.getRexBuilder(); for (RelDataTypeField field : model.getRowType().getFieldList()) { exprList.add(rexBuilder.makeZeroLiteral(field.getType())); } for (Ord<RexNode> expr : Ord.zip(project.getProjects())) { if (expr.e instanceof RexInputRef) { final int target = ((RexInputRef) expr.e).getIndex(); exprList.set(target, rexBuilder.ensureType(expr.e.getType(), RexInputRef.of(expr.i, input.rowType), false)); } else { throw MatchFailed.INSTANCE; } } return MutableProject.of(model.rowType, input, exprList); } } /** Implementation of {@link UnifyRule} that matches a * {@link MutableFilter}. */ private static class FilterToFilterUnifyRule extends AbstractUnifyRule { public static final FilterToFilterUnifyRule INSTANCE = new FilterToFilterUnifyRule(); private FilterToFilterUnifyRule() { super(operand(MutableFilter.class, query(0)), operand(MutableFilter.class, target(0)), 1); } public UnifyResult apply(UnifyRuleCall call) { // in.query can be rewritten in terms of in.target if its condition // is weaker. For example: // query: SELECT * FROM t WHERE x = 1 AND y = 2 // target: SELECT * FROM t WHERE x = 1 // transforms to // result: SELECT * FROM (target) WHERE y = 2 final MutableFilter query = (MutableFilter) call.query; final MutableFilter target = (MutableFilter) call.target; final MutableFilter newFilter = createFilter(query, target); if (newFilter == null) { return null; } return call.result(newFilter); } MutableFilter createFilter(MutableFilter query, MutableFilter target) { final RexNode newCondition = splitFilter(query.cluster.getRexBuilder(), query.getCondition(), target.getCondition()); if (newCondition == null) { // Could not map query onto target. return null; } if (newCondition.isAlwaysTrue()) { return target; } return MutableFilter.of(target, newCondition); } } /** Implementation of {@link UnifyRule} that matches a {@link MutableProject} * to a {@link MutableFilter}. */ private static class ProjectToFilterUnifyRule extends AbstractUnifyRule { public static final ProjectToFilterUnifyRule INSTANCE = new ProjectToFilterUnifyRule(); private ProjectToFilterUnifyRule() { super(operand(MutableProject.class, query(0)), operand(MutableFilter.class, target(0)), 1); } public UnifyResult apply(UnifyRuleCall call) { if (call.query.parent instanceof MutableFilter) { final UnifyRuleCall in2 = call.create(call.query.parent); final MutableFilter query = (MutableFilter) in2.query; final MutableFilter target = (MutableFilter) in2.target; final MutableFilter newFilter = FilterToFilterUnifyRule.INSTANCE.createFilter( query, target); if (newFilter == null) { return null; } return in2.result(query.replaceInParent(newFilter)); } return null; } } /** Implementation of {@link UnifyRule} that matches a * {@link org.apache.calcite.rel.logical.LogicalAggregate} to a * {@link org.apache.calcite.rel.logical.LogicalAggregate}, provided * that they have the same child. */ private static class AggregateToAggregateUnifyRule extends AbstractUnifyRule { public static final AggregateToAggregateUnifyRule INSTANCE = new AggregateToAggregateUnifyRule(); private AggregateToAggregateUnifyRule() { super(operand(MutableAggregate.class, query(0)), operand(MutableAggregate.class, target(0)), 1); } public UnifyResult apply(UnifyRuleCall call) { final MutableAggregate query = (MutableAggregate) call.query; final MutableAggregate target = (MutableAggregate) call.target; assert query != target; // in.query can be rewritten in terms of in.target if its groupSet is // a subset, and its aggCalls are a superset. For example: // query: SELECT x, COUNT(b) FROM t GROUP BY x // target: SELECT x, y, SUM(a) AS s, COUNT(b) AS cb FROM t GROUP BY x, y // transforms to // result: SELECT x, SUM(cb) FROM (target) GROUP BY x if (!target.getGroupSet().contains(query.getGroupSet())) { return null; } MutableRel result = unifyAggregates(query, target); if (result == null) { return null; } return call.result(result); } } public static MutableAggregate permute(MutableAggregate aggregate, MutableRel input, Mapping mapping) { ImmutableBitSet groupSet = Mappings.apply(mapping, aggregate.getGroupSet()); ImmutableList<ImmutableBitSet> groupSets = Mappings.apply2(mapping, aggregate.getGroupSets()); List<AggregateCall> aggregateCalls = apply(mapping, aggregate.getAggCallList()); return MutableAggregate.of(input, aggregate.indicator, groupSet, groupSets, aggregateCalls); } private static List<AggregateCall> apply(final Mapping mapping, List<AggregateCall> aggCallList) { return Lists.transform(aggCallList, new Function<AggregateCall, AggregateCall>() { public AggregateCall apply(AggregateCall call) { return call.copy(Mappings.apply2(mapping, call.getArgList()), Mappings.apply(mapping, call.filterArg)); } }); } public static MutableRel unifyAggregates(MutableAggregate query, MutableAggregate target) { if (query.getGroupType() != Aggregate.Group.SIMPLE || target.getGroupType() != Aggregate.Group.SIMPLE) { throw new AssertionError(Bug.CALCITE_461_FIXED); } MutableRel result; if (query.getGroupSet().equals(target.getGroupSet())) { // Same level of aggregation. Generate a project. final List<Integer> projects = Lists.newArrayList(); final int groupCount = query.getGroupSet().cardinality(); for (int i = 0; i < groupCount; i++) { projects.add(i); } for (AggregateCall aggregateCall : query.getAggCallList()) { int i = target.getAggCallList().indexOf(aggregateCall); if (i < 0) { return null; } projects.add(groupCount + i); } result = MutableRels.createProject(target, projects); } else { // Target is coarser level of aggregation. Generate an aggregate. final ImmutableBitSet.Builder groupSet = ImmutableBitSet.builder(); final IntList targetGroupList = target.getGroupSet().toList(); for (int c : query.getGroupSet()) { int c2 = targetGroupList.indexOf(c); if (c2 < 0) { return null; } groupSet.set(c2); } final List<AggregateCall> aggregateCalls = Lists.newArrayList(); for (AggregateCall aggregateCall : query.getAggCallList()) { if (aggregateCall.isDistinct()) { return null; } int i = target.getAggCallList().indexOf(aggregateCall); if (i < 0) { return null; } aggregateCalls.add( AggregateCall.create(getRollup(aggregateCall.getAggregation()), aggregateCall.isDistinct(), ImmutableList.of(target.groupSet.cardinality() + i), -1, aggregateCall.type, aggregateCall.name)); } result = MutableAggregate.of(target, false, groupSet.build(), null, aggregateCalls); } return MutableRels.createCastRel(result, query.getRowType(), true); } /** Implementation of {@link UnifyRule} that matches a * {@link MutableAggregate} on * a {@link MutableProject} query to an {@link MutableAggregate} target. * * <p>The rule is necessary when we unify query=Aggregate(x) with * target=Aggregate(x, y). Query will tend to have an extra Project(x) on its * input, which this rule knows is safe to ignore.</p> */ private static class AggregateOnProjectToAggregateUnifyRule extends AbstractUnifyRule { public static final AggregateOnProjectToAggregateUnifyRule INSTANCE = new AggregateOnProjectToAggregateUnifyRule(); private AggregateOnProjectToAggregateUnifyRule() { super( operand(MutableAggregate.class, operand(MutableProject.class, query(0))), operand(MutableAggregate.class, target(0)), 1); } public UnifyResult apply(UnifyRuleCall call) { final MutableAggregate query = (MutableAggregate) call.query; final MutableAggregate target = (MutableAggregate) call.target; if (!(query.getInput() instanceof MutableProject)) { return null; } final MutableProject project = (MutableProject) query.getInput(); if (project.getInput() != target.getInput()) { return null; } final Mappings.TargetMapping mapping = project.getMapping(); if (mapping == null) { return null; } final MutableAggregate aggregate2 = permute(query, project.getInput(), mapping.inverse()); final MutableRel result = unifyAggregates(aggregate2, target); return result == null ? null : call.result(result); } } public static SqlAggFunction getRollup(SqlAggFunction aggregation) { if (aggregation == SqlStdOperatorTable.SUM || aggregation == SqlStdOperatorTable.MIN || aggregation == SqlStdOperatorTable.MAX || aggregation == SqlStdOperatorTable.SUM0) { return aggregation; } else if (aggregation == SqlStdOperatorTable.COUNT) { return SqlStdOperatorTable.SUM0; } else { return null; } } /** Builds a shuttle that stores a list of expressions, and can map incoming * expressions to references to them. */ protected static RexShuttle getRexShuttle(MutableProject target) { final Map<String, Integer> map = new HashMap<>(); for (RexNode e : target.getProjects()) { map.put(e.toString(), map.size()); } return new RexShuttle() { @Override public RexNode visitInputRef(RexInputRef ref) { final Integer integer = map.get(ref.getName()); if (integer != null) { return new RexInputRef(integer, ref.getType()); } throw MatchFailed.INSTANCE; } @Override public RexNode visitCall(RexCall call) { final Integer integer = map.get(call.toString()); if (integer != null) { return new RexInputRef(integer, call.getType()); } return super.visitCall(call); } }; } /** Type of {@code MutableRel}. */ private enum MutableRelType { SCAN, PROJECT, FILTER, AGGREGATE, SORT, UNION, JOIN, HOLDER, VALUES } /** Visitor over {@link MutableRel}. */ private static class MutableRelVisitor { private MutableRel root; public void visit(MutableRel node) { node.childrenAccept(this); } public MutableRel go(MutableRel p) { this.root = p; visit(p); return root; } } /** Mutable equivalent of {@link RelNode}. * * <p>Each node has mutable state, and keeps track of its parent and position * within parent. * It doesn't make sense to canonize {@code MutableRels}, * otherwise one node could end up with multiple parents. * It follows that {@code #hashCode} and {@code #equals} are less efficient * than their {@code RelNode} counterparts. * But, you don't need to copy a {@code MutableRel} in order to change it. * For this reason, you should use {@code MutableRel} for short-lived * operations, and transcribe back to {@code RelNode} when you are done.</p> */ protected abstract static class MutableRel { MutableRel parent; int ordinalInParent; public final RelOptCluster cluster; final RelDataType rowType; final MutableRelType type; private MutableRel(RelOptCluster cluster, RelDataType rowType, MutableRelType type) { this.cluster = cluster; this.rowType = rowType; this.type = type; } public RelDataType getRowType() { return rowType; } public abstract void setInput(int ordinalInParent, MutableRel input); public abstract List<MutableRel> getInputs(); public abstract void childrenAccept(MutableRelVisitor visitor); /** Replaces this {@code MutableRel} in its parent with another node at the * same position. * * <p>Before the method, {@code child} must be an orphan (have null parent) * and after this method, this {@code MutableRel} is an orphan. * * @return The parent */ public MutableRel replaceInParent(MutableRel child) { final MutableRel parent = this.parent; if (this != child) { /* if (child.parent != null) { child.parent.setInput(child.ordinalInParent, null); child.parent = null; } */ if (parent != null) { parent.setInput(ordinalInParent, child); this.parent = null; this.ordinalInParent = 0; } } return parent; } public abstract StringBuilder digest(StringBuilder buf); public final String deep() { return new MutableRelDumper().apply(this); } @Override public final String toString() { return deep(); } public MutableRel getParent() { return parent; } } /** Implementation of {@link MutableRel} whose only purpose is to have a * child. Used as the root of a tree. */ private static class Holder extends MutableSingleRel { private Holder(MutableRelType type, RelDataType rowType, MutableRel input) { super(type, rowType, input); } static Holder of(MutableRel input) { return new Holder(MutableRelType.HOLDER, input.rowType, input); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Holder"); } } /** Abstract base class for implementations of {@link MutableRel} that have * no inputs. */ protected abstract static class MutableLeafRel extends MutableRel { protected final RelNode rel; MutableLeafRel(MutableRelType type, RelNode rel) { super(rel.getCluster(), rel.getRowType(), type); this.rel = rel; } public void setInput(int ordinalInParent, MutableRel input) { throw new IllegalArgumentException(); } public List<MutableRel> getInputs() { return ImmutableList.of(); } public void childrenAccept(MutableRelVisitor visitor) { // no children - nothing to do } } /** Mutable equivalent of {@link SingleRel}. */ protected abstract static class MutableSingleRel extends MutableRel { protected MutableRel input; MutableSingleRel(MutableRelType type, RelDataType rowType, MutableRel input) { super(input.cluster, rowType, type); this.input = input; input.parent = this; input.ordinalInParent = 0; } public void setInput(int ordinalInParent, MutableRel input) { if (ordinalInParent >= 1) { throw new IllegalArgumentException(); } this.input = input; if (input != null) { input.parent = this; input.ordinalInParent = 0; } } public List<MutableRel> getInputs() { return ImmutableList.of(input); } public void childrenAccept(MutableRelVisitor visitor) { visitor.visit(input); } public MutableRel getInput() { return input; } } /** Mutable equivalent of * {@link org.apache.calcite.rel.logical.LogicalTableScan}. */ protected static class MutableScan extends MutableLeafRel { private MutableScan(TableScan rel) { super(MutableRelType.SCAN, rel); } static MutableScan of(TableScan rel) { return new MutableScan(rel); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableScan && rel == ((MutableScan) obj).rel; } @Override public int hashCode() { return rel.hashCode(); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Scan(table: ") .append(rel.getTable().getQualifiedName()).append(")"); } } /** Mutable equivalent of {@link org.apache.calcite.rel.core.Values}. */ protected static class MutableValues extends MutableLeafRel { private MutableValues(Values rel) { super(MutableRelType.VALUES, rel); } static MutableValues of(Values rel) { return new MutableValues(rel); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableValues && rel == ((MutableValues) obj).rel; } @Override public int hashCode() { return rel.hashCode(); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Values(tuples: ") .append(((Values) rel).getTuples()).append(")"); } } /** Mutable equivalent of * {@link org.apache.calcite.rel.logical.LogicalProject}. */ protected static class MutableProject extends MutableSingleRel { private final List<RexNode> projects; private MutableProject(RelDataType rowType, MutableRel input, List<RexNode> projects) { super(MutableRelType.PROJECT, rowType, input); this.projects = projects; assert RexUtil.compatibleTypes(projects, rowType, true); } public static MutableProject of(RelDataType rowType, MutableRel input, List<RexNode> projects) { return new MutableProject(rowType, input, projects); } /** Equivalent to * {@link RelOptUtil#createProject(org.apache.calcite.rel.RelNode, java.util.List, java.util.List)} * for {@link MutableRel}. */ public static MutableRel of(MutableRel child, List<RexNode> exprList, List<String> fieldNameList) { final RelDataType rowType = RexUtil.createStructType(child.cluster.getTypeFactory(), exprList, fieldNameList == null ? null : SqlValidatorUtil.uniquify(fieldNameList, SqlValidatorUtil.F_SUGGESTER)); return of(rowType, child, exprList); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableProject && PAIRWISE_STRING_EQUIVALENCE.equivalent( projects, ((MutableProject) obj).projects) && input.equals(((MutableProject) obj).input); } @Override public int hashCode() { return Objects.hashCode(input, PAIRWISE_STRING_EQUIVALENCE.hash(projects)); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Project(projects: ").append(projects).append(")"); } public List<RexNode> getProjects() { return projects; } /** Returns a list of (expression, name) pairs. */ public final List<Pair<RexNode, String>> getNamedProjects() { return Pair.zip(getProjects(), getRowType().getFieldNames()); } public Mappings.TargetMapping getMapping() { return Project.getMapping( input.getRowType().getFieldCount(), projects); } } /** Mutable equivalent of * {@link org.apache.calcite.rel.logical.LogicalFilter}. */ protected static class MutableFilter extends MutableSingleRel { private final RexNode condition; private MutableFilter(MutableRel input, RexNode condition) { super(MutableRelType.FILTER, input.rowType, input); this.condition = condition; } public static MutableFilter of(MutableRel input, RexNode condition) { return new MutableFilter(input, condition); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableFilter && condition.toString().equals( ((MutableFilter) obj).condition.toString()) && input.equals(((MutableFilter) obj).input); } @Override public int hashCode() { return Objects.hashCode(input, condition.toString()); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Filter(condition: ").append(condition).append(")"); } public RexNode getCondition() { return condition; } } /** Mutable equivalent of * {@link org.apache.calcite.rel.logical.LogicalAggregate}. */ protected static class MutableAggregate extends MutableSingleRel { public final boolean indicator; private final ImmutableBitSet groupSet; private final ImmutableList<ImmutableBitSet> groupSets; private final List<AggregateCall> aggCalls; private MutableAggregate(MutableRel input, RelDataType rowType, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { super(MutableRelType.AGGREGATE, rowType, input); this.indicator = indicator; this.groupSet = groupSet; this.groupSets = groupSets == null ? ImmutableList.of(groupSet) : ImmutableList.copyOf(groupSets); this.aggCalls = aggCalls; } static MutableAggregate of(MutableRel input, boolean indicator, ImmutableBitSet groupSet, ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { RelDataType rowType = Aggregate.deriveRowType(input.cluster.getTypeFactory(), input.getRowType(), indicator, groupSet, groupSets, aggCalls); return new MutableAggregate(input, rowType, indicator, groupSet, groupSets, aggCalls); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableAggregate && groupSet.equals(((MutableAggregate) obj).groupSet) && aggCalls.equals(((MutableAggregate) obj).aggCalls) && input.equals(((MutableAggregate) obj).input); } @Override public int hashCode() { return Objects.hashCode(input, groupSet, aggCalls); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Aggregate(groupSet: ").append(groupSet) .append(", groupSets: ").append(groupSets) .append(", calls: ").append(aggCalls).append(")"); } public ImmutableBitSet getGroupSet() { return groupSet; } public ImmutableList<ImmutableBitSet> getGroupSets() { return groupSets; } public List<AggregateCall> getAggCallList() { return aggCalls; } public Aggregate.Group getGroupType() { return Aggregate.Group.induce(groupSet, groupSets); } } /** Mutable equivalent of {@link org.apache.calcite.rel.core.Sort}. */ protected static class MutableSort extends MutableSingleRel { private final RelCollation collation; private final RexNode offset; private final RexNode fetch; private MutableSort(MutableRel input, RelCollation collation, RexNode offset, RexNode fetch) { super(MutableRelType.SORT, input.rowType, input); this.collation = collation; this.offset = offset; this.fetch = fetch; } static MutableSort of(MutableRel input, RelCollation collation, RexNode offset, RexNode fetch) { return new MutableSort(input, collation, offset, fetch); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableSort && collation.equals(((MutableSort) obj).collation) && Objects.equal(offset, ((MutableSort) obj).offset) && Objects.equal(fetch, ((MutableSort) obj).fetch) && input.equals(((MutableSort) obj).input); } @Override public int hashCode() { return Objects.hashCode(input, collation, offset, fetch); } @Override public StringBuilder digest(StringBuilder buf) { buf.append("Sort(collation: ").append(collation); if (offset != null) { buf.append(", offset: ").append(offset); } if (fetch != null) { buf.append(", fetch: ").append(fetch); } return buf.append(")"); } } /** Base class for set-operations. */ protected abstract static class MutableSetOp extends MutableRel { protected final List<MutableRel> inputs; private MutableSetOp(RelOptCluster cluster, RelDataType rowType, MutableRelType type, List<MutableRel> inputs) { super(cluster, rowType, type); this.inputs = inputs; } @Override public void setInput(int ordinalInParent, MutableRel input) { inputs.set(ordinalInParent, input); if (input != null) { input.parent = this; input.ordinalInParent = ordinalInParent; } } @Override public List<MutableRel> getInputs() { return inputs; } @Override public void childrenAccept(MutableRelVisitor visitor) { for (MutableRel input : inputs) { visitor.visit(input); } } } /** Mutable equivalent of * {@link org.apache.calcite.rel.logical.LogicalUnion}. */ protected static class MutableUnion extends MutableSetOp { public boolean all; private MutableUnion(RelOptCluster cluster, RelDataType rowType, List<MutableRel> inputs, boolean all) { super(cluster, rowType, MutableRelType.UNION, inputs); this.all = all; } static MutableUnion of(List<MutableRel> inputs, boolean all) { assert inputs.size() >= 2; final MutableRel input0 = inputs.get(0); return new MutableUnion(input0.cluster, input0.rowType, inputs, all); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableUnion && inputs.equals(((MutableUnion) obj).getInputs()); } @Override public int hashCode() { return Objects.hashCode(type, inputs); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Union"); } } /** Base Class for relations with two inputs */ private abstract static class MutableBiRel extends MutableRel { protected MutableRel left; protected MutableRel right; MutableBiRel(MutableRelType type, RelOptCluster cluster, RelDataType rowType, MutableRel left, MutableRel right) { super(cluster, rowType, type); this.left = left; left.parent = this; left.ordinalInParent = 0; this.right = right; right.parent = this; right.ordinalInParent = 1; } public void setInput(int ordinalInParent, MutableRel input) { if (ordinalInParent > 1) { throw new IllegalArgumentException(); } if (ordinalInParent == 0) { this.left = input; } else { this.right = input; } if (input != null) { input.parent = this; input.ordinalInParent = ordinalInParent; } } public List<MutableRel> getInputs() { return ImmutableList.of(left, right); } public MutableRel getLeft() { return left; } public MutableRel getRight() { return right; } public void childrenAccept(MutableRelVisitor visitor) { visitor.visit(left); visitor.visit(right); } } /** Mutable equivalent of * {@link org.apache.calcite.rel.logical.LogicalJoin}. */ private static class MutableJoin extends MutableBiRel { //~ Instance fields -------------------------------------------------------- protected final RexNode condition; protected final ImmutableSet<String> variablesStopped; /** * Values must be of enumeration {@link JoinRelType}, except that * {@link JoinRelType#RIGHT} is disallowed. */ protected JoinRelType joinType; private MutableJoin( RelDataType rowType, MutableRel left, MutableRel right, RexNode condition, JoinRelType joinType, Set<String> variablesStopped) { super(MutableRelType.JOIN, left.cluster, rowType, left, right); this.condition = Preconditions.checkNotNull(condition); this.variablesStopped = ImmutableSet.copyOf(variablesStopped); this.joinType = Preconditions.checkNotNull(joinType); } public RexNode getCondition() { return condition; } public JoinRelType getJoinType() { return joinType; } public ImmutableSet getVariablesStopped() { return variablesStopped; } static MutableJoin of(RelOptCluster cluster, MutableRel left, MutableRel right, RexNode condition, JoinRelType joinType, Set<String> variablesStopped) { List<RelDataTypeField> fieldList = Collections.emptyList(); RelDataType rowType = Join.deriveJoinRowType(left.getRowType(), right.getRowType(), joinType, cluster.getTypeFactory(), null, fieldList); return new MutableJoin(rowType, left, right, condition, joinType, variablesStopped); } @Override public boolean equals(Object obj) { return obj == this || obj instanceof MutableJoin && joinType == ((MutableJoin) obj).joinType && condition.toString().equals( ((MutableJoin) obj).condition.toString()) && left.equals(((MutableJoin) obj).left) && right.equals(((MutableJoin) obj).right); } @Override public int hashCode() { return Objects.hashCode(left, right, condition.toString(), joinType); } @Override public StringBuilder digest(StringBuilder buf) { return buf.append("Join(left: ").append(left) .append(", right:").append(right) .append(")"); } } /** Utilities for dealing with {@link MutableRel}s. */ protected static class MutableRels { public static boolean contains(MutableRel ancestor, final MutableRel target) { if (ancestor.equals(target)) { // Short-cut common case. return true; } try { new MutableRelVisitor() { @Override public void visit(MutableRel node) { if (node.equals(target)) { throw Util.FoundOne.NULL; } super.visit(node); } // CHECKSTYLE: IGNORE 1 }.go(ancestor); return false; } catch (Util.FoundOne e) { return true; } } public static MutableRel preOrderTraverseNext(MutableRel node) { MutableRel parent = node.getParent(); int ordinal = node.ordinalInParent + 1; while (parent != null) { if (parent.getInputs().size() > ordinal) { return parent.getInputs().get(ordinal); } node = parent; parent = node.getParent(); ordinal = node.ordinalInParent + 1; } return null; } private static List<MutableRel> descendants(MutableRel query) { final List<MutableRel> list = new ArrayList<>(); descendantsRecurse(list, query); return list; } private static void descendantsRecurse(List<MutableRel> list, MutableRel rel) { list.add(rel); for (MutableRel input : rel.getInputs()) { descendantsRecurse(list, input); } } /** Returns whether two relational expressions have the same row-type. */ public static boolean equalType(String desc0, MutableRel rel0, String desc1, MutableRel rel1, boolean fail) { return RelOptUtil.equal(desc0, rel0.getRowType(), desc1, rel1.getRowType(), fail); } /** Within a relational expression {@code query}, replaces occurrences of * {@code find} with {@code replace}. * * <p>Assumes relational expressions (and their descendants) are not null. * Does not handle cycles. */ public static Replacement replace(MutableRel query, MutableRel find, MutableRel replace) { if (find.equals(replace)) { // Short-cut common case. return null; } assert equalType("find", find, "replace", replace, true); return replaceRecurse(query, find, replace); } /** Helper for {@link #replace}. */ private static Replacement replaceRecurse(MutableRel query, MutableRel find, MutableRel replace) { if (find.equals(query)) { query.replaceInParent(replace); return new Replacement(query, replace); } for (MutableRel input : query.getInputs()) { Replacement r = replaceRecurse(input, find, replace); if (r != null) { return r; } } return null; } /** Based on * {@link org.apache.calcite.rel.rules.ProjectRemoveRule#strip}. */ public static MutableRel strip(MutableProject project) { return isTrivial(project) ? project.getInput() : project; } /** Based on * {@link org.apache.calcite.rel.rules.ProjectRemoveRule#isTrivial(org.apache.calcite.rel.core.Project)}. */ public static boolean isTrivial(MutableProject project) { MutableRel child = project.getInput(); final RelDataType childRowType = child.getRowType(); return ProjectRemoveRule.isIdentity(project.getProjects(), childRowType); } /** Equivalent to * {@link RelOptUtil#createProject(org.apache.calcite.rel.RelNode, java.util.List)} * for {@link MutableRel}. */ public static MutableRel createProject(final MutableRel child, final List<Integer> posList) { final RelDataType rowType = child.getRowType(); if (Mappings.isIdentity(posList, rowType.getFieldCount())) { return child; } return MutableProject.of( RelOptUtil.permute(child.cluster.getTypeFactory(), rowType, Mappings.bijection(posList)), child, new AbstractList<RexNode>() { public int size() { return posList.size(); } public RexNode get(int index) { final int pos = posList.get(index); return RexInputRef.of(pos, rowType); } }); } /** Equivalence to {@link org.apache.calcite.plan.RelOptUtil#createCastRel} * for {@link MutableRel}. */ public static MutableRel createCastRel(MutableRel rel, RelDataType castRowType, boolean rename) { RelDataType rowType = rel.getRowType(); if (RelOptUtil.areRowTypesEqual(rowType, castRowType, rename)) { // nothing to do return rel; } List<RexNode> castExps = RexUtil.generateCastExpressions(rel.cluster.getRexBuilder(), castRowType, rowType); final List<String> fieldNames = rename ? castRowType.getFieldNames() : rowType.getFieldNames(); return MutableProject.of(rel, castExps, fieldNames); } } /** Visitor that prints an indented tree of {@link MutableRel}s. */ protected static class MutableRelDumper extends MutableRelVisitor { private final StringBuilder buf = new StringBuilder(); private int level; @Override public void visit(MutableRel node) { Spaces.append(buf, level * 2); if (node == null) { buf.append("null"); } else { node.digest(buf); buf.append("\n"); ++level; super.visit(node); --level; } } public String apply(MutableRel rel) { go(rel); return buf.toString(); } } /** Operand to a {@link UnifyRule}. */ protected abstract static class Operand { protected final Class<? extends MutableRel> clazz; protected Operand(Class<? extends MutableRel> clazz) { this.clazz = clazz; } public abstract boolean matches(SubstitutionVisitor visitor, MutableRel rel); public boolean isWeaker(SubstitutionVisitor visitor, MutableRel rel) { return false; } } /** Operand to a {@link UnifyRule} that matches a relational expression of a * given type. It has zero or more child operands. */ private static class InternalOperand extends Operand { private final List<Operand> inputs; InternalOperand(Class<? extends MutableRel> clazz, List<Operand> inputs) { super(clazz); this.inputs = inputs; } @Override public boolean matches(SubstitutionVisitor visitor, MutableRel rel) { return clazz.isInstance(rel) && allMatch(visitor, inputs, rel.getInputs()); } @Override public boolean isWeaker(SubstitutionVisitor visitor, MutableRel rel) { return clazz.isInstance(rel) && allWeaker(visitor, inputs, rel.getInputs()); } private static boolean allMatch(SubstitutionVisitor visitor, List<Operand> operands, List<MutableRel> rels) { if (operands.size() != rels.size()) { return false; } for (Pair<Operand, MutableRel> pair : Pair.zip(operands, rels)) { if (!pair.left.matches(visitor, pair.right)) { return false; } } return true; } private static boolean allWeaker( SubstitutionVisitor visitor, List<Operand> operands, List<MutableRel> rels) { if (operands.size() != rels.size()) { return false; } for (Pair<Operand, MutableRel> pair : Pair.zip(operands, rels)) { if (!pair.left.isWeaker(visitor, pair.right)) { return false; } } return true; } } /** Operand to a {@link UnifyRule} that matches a relational expression of a * given type. */ private static class AnyOperand extends Operand { AnyOperand(Class<? extends MutableRel> clazz) { super(clazz); } @Override public boolean matches(SubstitutionVisitor visitor, MutableRel rel) { return clazz.isInstance(rel); } } /** Operand that assigns a particular relational expression to a variable. * * <p>It is applied to a descendant of the query, writes the operand into the * slots array, and always matches. * There is a corresponding operand of type {@link TargetOperand} that checks * whether its relational expression, a descendant of the target, is * equivalent to this {@code QueryOperand}'s relational expression. */ private static class QueryOperand extends Operand { private final int ordinal; protected QueryOperand(int ordinal) { super(MutableRel.class); this.ordinal = ordinal; } @Override public boolean matches(SubstitutionVisitor visitor, MutableRel rel) { visitor.slots[ordinal] = rel; return true; } } /** Operand that checks that a relational expression matches the corresponding * relational expression that was passed to a {@link QueryOperand}. */ private static class TargetOperand extends Operand { private final int ordinal; protected TargetOperand(int ordinal) { super(MutableRel.class); this.ordinal = ordinal; } @Override public boolean matches(SubstitutionVisitor visitor, MutableRel rel) { final MutableRel rel0 = visitor.slots[ordinal]; assert rel0 != null : "QueryOperand should have been called first"; return rel0 == rel || visitor.equivalents.get(rel0).contains(rel); } @Override public boolean isWeaker(SubstitutionVisitor visitor, MutableRel rel) { final MutableRel rel0 = visitor.slots[ordinal]; assert rel0 != null : "QueryOperand should have been called first"; if (rel0 == rel || visitor.equivalents.get(rel0).contains(rel)) { return false; } if (!(rel0 instanceof MutableFilter) || !(rel instanceof MutableFilter)) { return false; } if (!rel.getRowType().equals(rel0.getRowType())) { return false; } final MutableRel rel0input = ((MutableFilter) rel0).getInput(); final MutableRel relinput = ((MutableFilter) rel).getInput(); if (rel0input != relinput && !visitor.equivalents.get(rel0input).contains(relinput)) { return false; } RexExecutorImpl rexImpl = (RexExecutorImpl) (rel.cluster.getPlanner().getExecutor()); RexImplicationChecker rexImplicationChecker = new RexImplicationChecker( rel.cluster.getRexBuilder(), rexImpl, rel.getRowType()); return rexImplicationChecker.implies(((MutableFilter) rel0).getCondition(), ((MutableFilter) rel).getCondition()); } } /** Visitor that counts how many {@link QueryOperand} and * {@link TargetOperand} in an operand tree. */ private static class SlotCounter { int queryCount; int targetCount; void visit(Operand operand) { if (operand instanceof QueryOperand) { ++queryCount; } else if (operand instanceof TargetOperand) { ++targetCount; } else if (operand instanceof AnyOperand) { // nothing } else { for (Operand input : ((InternalOperand) operand).inputs) { visit(input); } } } } /** * Rule that converts a {@link org.apache.calcite.rel.logical.LogicalFilter} * on top of a {@link org.apache.calcite.rel.logical.LogicalProject} into a * trivial filter (on a boolean column). */ public static class FilterOnProjectRule extends RelOptRule { private static final Predicate<LogicalFilter> PREDICATE = new Predicate<LogicalFilter>() { public boolean apply(LogicalFilter input) { return input.getCondition() instanceof RexInputRef; } }; public static final FilterOnProjectRule INSTANCE = new FilterOnProjectRule(); private FilterOnProjectRule() { super( operand(LogicalFilter.class, null, PREDICATE, some(operand(LogicalProject.class, any())))); } public void onMatch(RelOptRuleCall call) { final LogicalFilter filter = call.rel(0); final LogicalProject project = call.rel(1); final List<RexNode> newProjects = new ArrayList<>(project.getProjects()); newProjects.add(filter.getCondition()); final RelOptCluster cluster = filter.getCluster(); RelDataType newRowType = cluster.getTypeFactory().builder() .addAll(project.getRowType().getFieldList()) .add("condition", Util.last(newProjects).getType()) .build(); final RelNode newProject = project.copy(project.getTraitSet(), project.getInput(), newProjects, newRowType); final RexInputRef newCondition = cluster.getRexBuilder().makeInputRef(newProject, newProjects.size() - 1); call.transformTo(LogicalFilter.create(newProject, newCondition)); } } } // End SubstitutionVisitor.java
92452a069443a2043a014d70ab44c9b72a54fdee
971
java
Java
src/main/java/net/xeric/maven/H2Utils.java
andyglick/xeric-h2-maven-plugin
4b45d7d6821c12035071748cf1f18e616793f87f
[ "Apache-2.0" ]
1
2016-07-28T13:37:47.000Z
2016-07-28T13:37:47.000Z
src/main/java/net/xeric/maven/H2Utils.java
andyglick/xeric-h2-maven-plugin
4b45d7d6821c12035071748cf1f18e616793f87f
[ "Apache-2.0" ]
null
null
null
src/main/java/net/xeric/maven/H2Utils.java
andyglick/xeric-h2-maven-plugin
4b45d7d6821c12035071748cf1f18e616793f87f
[ "Apache-2.0" ]
null
null
null
28.558824
75
0.715757
1,003,274
// Copyright 2013 Xeric Corporation // // 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 applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package net.xeric.maven; import org.h2.tools.Server; import java.sql.SQLException; public class H2Utils { public static Server startServer(String [] args) throws SQLException { Server server = Server.createTcpServer(args); server.start(); return server; } public static void stopServer(Server server){ server.stop(); } }
92452aa92879faaabd48924cdf32085980b5bf93
4,334
java
Java
react-native-kf5sdk/android/src/main/java/com/kf5/sdk/ticket/entity/Requester.java
KF5/react-native-kf5sdk
8cceae26d42d636a96a1109729e4ed91c6dabc4c
[ "MIT" ]
null
null
null
react-native-kf5sdk/android/src/main/java/com/kf5/sdk/ticket/entity/Requester.java
KF5/react-native-kf5sdk
8cceae26d42d636a96a1109729e4ed91c6dabc4c
[ "MIT" ]
null
null
null
react-native-kf5sdk/android/src/main/java/com/kf5/sdk/ticket/entity/Requester.java
KF5/react-native-kf5sdk
8cceae26d42d636a96a1109729e4ed91c6dabc4c
[ "MIT" ]
null
null
null
19.967742
60
0.642511
1,003,275
package com.kf5.sdk.ticket.entity; import com.google.gson.annotations.SerializedName; import com.kf5.sdk.system.entity.Field; import java.io.Serializable; /** * author:chosen * date:2016/10/20 14:04 * email:[email protected] */ public class Requester implements Serializable { /** * */ private static final long serialVersionUID = 1L; @SerializedName(Field.ID) private int id; private String url; @SerializedName(Field.TITLE) private String title; @SerializedName(Field.DESCRIPTION) private String description; private String type; @SerializedName(Field.STATUS) private int status; private String priority; private String rquester_id; private String assignee_id; private String organization_id; private String group_id; private String due_date; @SerializedName(Field.CREATED_AT) private int created_at; @SerializedName(Field.UPDATED_AT) private int updated_at; @SerializedName(Field.LAST_COMMENT_ID) private int last_comment_id; @SerializedName(Field.RATING) private int rating; @SerializedName(Field.RATING_CONTENT) private String ratingContent; @SerializedName(Field.RATING_FLAG) private boolean ratingFlag; @SerializedName(Field.RATE_LEVEL_COUNT) private int rateLevelCount; public int getRateLevelCount() { return rateLevelCount; } public void setRateLevelCount(int rateLevelCount) { this.rateLevelCount = rateLevelCount; } public int getRating() { return rating; } public void setRating(int rating) { this.rating = rating; } public String getRatingContent() { return ratingContent; } public void setRatingContent(String ratingContent) { this.ratingContent = ratingContent; } public boolean isRatingFlag() { return ratingFlag; } public void setRatingFlag(boolean ratingFlag) { this.ratingFlag = ratingFlag; } public int getLast_comment_id() { return last_comment_id; } public void setLast_comment_id(int last_comment_id) { this.last_comment_id = last_comment_id; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getType() { return type; } public void setType(String type) { this.type = type; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public String getPriority() { return priority; } public void setPriority(String priority) { this.priority = priority; } public String getRquester_id() { return rquester_id; } public void setRquester_id(String rquester_id) { this.rquester_id = rquester_id; } public String getAssignee_id() { return assignee_id; } public void setAssignee_id(String assignee_id) { this.assignee_id = assignee_id; } public String getOrganization_id() { return organization_id; } public void setOrganization_id(String organization_id) { this.organization_id = organization_id; } public String getGroup_id() { return group_id; } public void setGroup_id(String group_id) { this.group_id = group_id; } public String getDue_date() { return due_date; } public void setDue_date(String due_date) { this.due_date = due_date; } public int getCreated_at() { return created_at; } public void setCreated_at(int created_at) { this.created_at = created_at; } public int getUpdated_at() { return updated_at; } public void setUpdated_at(int updated_at) { this.updated_at = updated_at; } }
92452b09dc1fdaafc46961e27d94323dfc1673e3
83,487
java
Java
aware-core/src/main/java/com/aware/Aware.java
JulioV/aware-client-SKIP-fork
a0535ca7a52f8bfa1a0f952712c90c43f930d588
[ "Apache-2.0" ]
null
null
null
aware-core/src/main/java/com/aware/Aware.java
JulioV/aware-client-SKIP-fork
a0535ca7a52f8bfa1a0f952712c90c43f930d588
[ "Apache-2.0" ]
null
null
null
aware-core/src/main/java/com/aware/Aware.java
JulioV/aware-client-SKIP-fork
a0535ca7a52f8bfa1a0f952712c90c43f930d588
[ "Apache-2.0" ]
null
null
null
42.101362
366
0.623271
1,003,276
package com.aware; import android.app.AlarmManager; import android.app.PendingIntent; import android.app.Service; import android.app.UiModeManager; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Configuration; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteException; import android.graphics.Color; import android.net.Uri; import android.os.AsyncTask; import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.os.IBinder; import android.preference.PreferenceManager; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.aware.providers.Aware_Provider; import com.aware.providers.Aware_Provider.Aware_Device; import com.aware.providers.Aware_Provider.Aware_Plugins; import com.aware.providers.Aware_Provider.Aware_Settings; import com.aware.providers.Scheduler_Provider; import com.aware.utils.Aware_Plugin; import com.aware.utils.DownloadPluginService; import com.aware.utils.Http; import com.aware.utils.Https; import com.aware.utils.PluginsManager; import com.aware.utils.SSLManager; import com.aware.utils.Scheduler; import com.aware.utils.StudyUtils; import com.aware.utils.WebserviceHelper; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.FileNotFoundException; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Enumeration; import java.util.Hashtable; import java.util.Map; import java.util.UUID; import dalvik.system.DexFile; /** * Main AWARE framework service. awareContext will start and manage all the services and settings. * * @author denzil */ public class Aware extends Service { /** * Debug flag (default = false). */ public static boolean DEBUG = false; /** * Debug tag (default = "AWARE"). */ public static String TAG = "AWARE"; /** * Broadcasted event: awareContext device information is available */ public static final String ACTION_AWARE_DEVICE_INFORMATION = "ACTION_AWARE_DEVICE_INFORMATION"; /** * Received broadcast on all modules * - Sends the data to the defined webserver */ public static final String ACTION_AWARE_SYNC_DATA = "ACTION_AWARE_SYNC_DATA"; /** * Received broadcast on all modules * - Cleans the data collected on the device */ public static final String ACTION_AWARE_CLEAR_DATA = "ACTION_AWARE_CLEAR_DATA"; /** * Received broadcast: refresh the framework active sensors. */ public static final String ACTION_AWARE_REFRESH = "ACTION_AWARE_REFRESH"; /** * Received broadcast: this broadcast will trigger plugins that implement the CONTEXT_PRODUCER callback. */ public static final String ACTION_AWARE_CURRENT_CONTEXT = "ACTION_AWARE_CURRENT_CONTEXT"; /** * Stop all plugins */ public static final String ACTION_AWARE_STOP_PLUGINS = "ACTION_AWARE_STOP_PLUGINS"; /** * Stop all sensors */ public static final String ACTION_AWARE_STOP_SENSORS = "ACTION_AWARE_STOP_SENSORS"; /** * Received broadcast on all modules * - Cleans old data from the content providers */ public static final String ACTION_AWARE_SPACE_MAINTENANCE = "ACTION_AWARE_SPACE_MAINTENANCE"; /** * Used by Plugin Manager to refresh UI */ public static final String ACTION_AWARE_UPDATE_PLUGINS_INFO = "ACTION_AWARE_UPDATE_PLUGINS_INFO"; /** * Used when quitting a study. This will reset the device to default settings. */ public static final String ACTION_QUIT_STUDY = "ACTION_QUIT_STUDY"; /** * Used on the scheduler class to define global schedules for AWARE, SYNC and SPACE MAINTENANCE actions */ public static final String SCHEDULE_SPACE_MAINTENANCE = "schedule_aware_space_maintenance"; public static final String SCHEDULE_SYNC_DATA = "schedule_aware_sync_data"; public static String STUDY_ID = "study_id"; public static String STUDY_START = "study_start"; private static AlarmManager alarmManager = null; private static PendingIntent repeatingIntent = null; private static Context awareContext = null; private static Intent awareStatusMonitor = null; private static Intent applicationsSrv = null; private static Intent accelerometerSrv = null; private static Intent locationsSrv = null; private static Intent bluetoothSrv = null; private static Intent screenSrv = null; private static Intent batterySrv = null; private static Intent networkSrv = null; private static Intent trafficSrv = null; private static Intent communicationSrv = null; private static Intent processorSrv = null; private static Intent mqttSrv = null; private static Intent gyroSrv = null; private static Intent wifiSrv = null; private static Intent telephonySrv = null; private static Intent timeZoneSrv = null; private static Intent rotationSrv = null; private static Intent lightSrv = null; private static Intent proximitySrv = null; private static Intent magnetoSrv = null; private static Intent barometerSrv = null; private static Intent gravitySrv = null; private static Intent linear_accelSrv = null; private static Intent temperatureSrv = null; private static Intent esmSrv = null; private static Intent installationsSrv = null; private static Intent keyboard = null; private static Intent scheduler = null; private final static String PREF_FREQUENCY_WATCHDOG = "frequency_watchdog"; private final static String PREF_LAST_UPDATE = "last_update"; private final static int CONST_FREQUENCY_WATCHDOG = 5 * 60; //5 minutes check private static SharedPreferences aware_preferences; /** * Singleton instance of the framework */ private static Aware awareSrv = Aware.getService(); /** * Get the singleton instance to the AWARE framework * * @return {@link Aware} obj */ public static Aware getService() { if (awareSrv == null) awareSrv = new Aware(); return awareSrv; } /** * Activity-Service binder */ private final IBinder serviceBinder = new ServiceBinder(); public class ServiceBinder extends Binder { Aware getService() { return Aware.getService(); } } @Override public IBinder onBind(Intent intent) { return serviceBinder; } @Override public void onCreate() { super.onCreate(); awareContext = getApplicationContext(); alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); IntentFilter storage = new IntentFilter(); storage.addAction(Intent.ACTION_MEDIA_MOUNTED); storage.addAction(Intent.ACTION_MEDIA_UNMOUNTED); storage.addDataScheme("file"); awareContext.registerReceiver(storage_BR, storage); IntentFilter awareactions = new IntentFilter(); awareactions.addAction(Aware.ACTION_AWARE_CLEAR_DATA); awareactions.addAction(Aware.ACTION_AWARE_REFRESH); awareactions.addAction(Aware.ACTION_AWARE_SYNC_DATA); awareactions.addAction(Aware.ACTION_QUIT_STUDY); awareContext.registerReceiver(aware_BR, awareactions); IntentFilter boot = new IntentFilter(); boot.addAction(Intent.ACTION_BOOT_COMPLETED); awareContext.registerReceiver(awareBoot, boot); if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { stopSelf(); return; } aware_preferences = getSharedPreferences("aware_core_prefs", MODE_PRIVATE); if (aware_preferences.getAll().isEmpty()) { SharedPreferences.Editor editor = aware_preferences.edit(); editor.putInt(PREF_FREQUENCY_WATCHDOG, CONST_FREQUENCY_WATCHDOG); editor.putLong(PREF_LAST_UPDATE, 0); editor.commit(); } //this sets the default settings to all plugins too SharedPreferences prefs = getSharedPreferences("com.aware", Context.MODE_PRIVATE); if (prefs.getAll().isEmpty() && Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID).length() == 0) { PreferenceManager.setDefaultValues(getApplicationContext(), getPackageName(), Context.MODE_PRIVATE, R.xml.aware_preferences, true); prefs.edit().commit(); //commit changes } else { PreferenceManager.setDefaultValues(getApplicationContext(), getPackageName(), Context.MODE_PRIVATE, R.xml.aware_preferences, false); } Map<String, ?> defaults = prefs.getAll(); for (Map.Entry<String, ?> entry : defaults.entrySet()) { if (Aware.getSetting(getApplicationContext(), entry.getKey(), "com.aware.phone").length() == 0) { Aware.setSetting(getApplicationContext(), entry.getKey(), entry.getValue(), "com.aware.phone"); //default AWARE settings } } if (Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID).length() == 0) { UUID uuid = UUID.randomUUID(); Aware.setSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID, uuid.toString(), "com.aware.phone"); } if (Aware.getSetting(getApplicationContext(), Aware_Preferences.WEBSERVICE_SERVER).length() == 0) { Aware.setSetting(getApplicationContext(), Aware_Preferences.WEBSERVICE_SERVER, "https://api.awareframework.com/index.php"); } //Load default awareframework.com SSL certificate for shared public plugins Intent aware_SSL = new Intent(this, SSLManager.class); aware_SSL.putExtra(SSLManager.EXTRA_SERVER, "https://api.awareframework.com/index.php"); startService(aware_SSL); DEBUG = Aware.getSetting(awareContext, Aware_Preferences.DEBUG_FLAG).equals("true"); TAG = Aware.getSetting(awareContext, Aware_Preferences.DEBUG_TAG).length() > 0 ? Aware.getSetting(awareContext, Aware_Preferences.DEBUG_TAG) : TAG; get_device_info(); if (Aware.DEBUG) Log.d(TAG, "AWARE framework is created!"); new AsyncPing().execute(); awareStatusMonitor = new Intent(this, Aware.class); repeatingIntent = PendingIntent.getService(getApplicationContext(), 0, awareStatusMonitor, 0); alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 1000, aware_preferences.getInt(PREF_FREQUENCY_WATCHDOG, 300) * 1000, repeatingIntent); // Set sync schedule to Aware server every day around midnight Aware.setSetting(this, Aware_Preferences.STATUS_BATTERY, true); Aware.setSetting(this, Aware_Preferences.WEBSERVICE_WIFI_ONLY, true); Scheduler.Schedule schedule = new Scheduler.Schedule("serverSync"); try { schedule.addContext(Battery.ACTION_AWARE_BATTERY_CHARGING); schedule.addHour(0).addHour(1); schedule.setActionType(Scheduler.ACTION_TYPE_BROADCAST); schedule.setActionClass(Aware.ACTION_AWARE_SYNC_DATA); Scheduler.saveSchedule(this, schedule); } catch (JSONException e) { e.printStackTrace(); if (Aware.DEBUG) Log.d(TAG, "Sync schedule failed: " + e.getMessage()); } } private class AsyncPing extends AsyncTask<Void, Void, Boolean> { @Override protected Boolean doInBackground(Void... params) { //Ping AWARE's server with awareContext device's information for framework's statistics log Hashtable<String, String> device_ping = new Hashtable<>(); device_ping.put(Aware_Preferences.DEVICE_ID, Aware.getSetting(awareContext, Aware_Preferences.DEVICE_ID)); device_ping.put("ping", String.valueOf(System.currentTimeMillis())); try { new Https(awareContext, SSLManager.getHTTPS(getApplicationContext(), "https://api.awareframework.com/index.php")).dataPOST("https://api.awareframework.com/index.php/awaredev/alive", device_ping, true); } catch (FileNotFoundException e) { e.printStackTrace(); } return true; } } private void get_device_info() { Cursor awareContextDevice = awareContext.getContentResolver().query(Aware_Device.CONTENT_URI, null, null, null, null); if (awareContextDevice == null || !awareContextDevice.moveToFirst()) { ContentValues rowData = new ContentValues(); rowData.put(Aware_Device.TIMESTAMP, System.currentTimeMillis()); rowData.put(Aware_Device.DEVICE_ID, Aware.getSetting(awareContext, Aware_Preferences.DEVICE_ID)); rowData.put(Aware_Device.BOARD, Build.BOARD); rowData.put(Aware_Device.BRAND, Build.BRAND); rowData.put(Aware_Device.DEVICE, Build.DEVICE); rowData.put(Aware_Device.BUILD_ID, Build.DISPLAY); rowData.put(Aware_Device.HARDWARE, Build.HARDWARE); rowData.put(Aware_Device.MANUFACTURER, Build.MANUFACTURER); rowData.put(Aware_Device.MODEL, Build.MODEL); rowData.put(Aware_Device.PRODUCT, Build.PRODUCT); rowData.put(Aware_Device.SERIAL, Build.SERIAL); rowData.put(Aware_Device.RELEASE, Build.VERSION.RELEASE); rowData.put(Aware_Device.RELEASE_TYPE, Build.TYPE); rowData.put(Aware_Device.SDK, Build.VERSION.SDK_INT); rowData.put(Aware_Device.LABEL, Aware.getSetting(awareContext, Aware_Preferences.DEVICE_LABEL)); try { awareContext.getContentResolver().insert(Aware_Device.CONTENT_URI, rowData); Intent deviceData = new Intent(ACTION_AWARE_DEVICE_INFORMATION); sendBroadcast(deviceData); if (Aware.DEBUG) Log.d(TAG, "Device information:" + rowData.toString()); } catch (SQLiteException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } catch (SQLException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } } if (awareContextDevice != null && !awareContextDevice.isClosed()) awareContextDevice.close(); } /** * Identifies if the device is a watch or a phone. * * @param c * @return boolean */ public static boolean is_watch(Context c) { UiModeManager uiManager = (UiModeManager) c.getSystemService(Context.UI_MODE_SERVICE); if (uiManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_WATCH) { return true; } return false; } /** * Identifies if the devices is enrolled in a study * * @param c * @return */ public static boolean isStudy(Context c) { return (Aware.getSetting(c, Aware.STUDY_ID).length() > 0); } @Override public int onStartCommand(Intent intent, int flags, int startId) { if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { DEBUG = Aware.getSetting(awareContext, Aware_Preferences.DEBUG_FLAG).equals("true"); TAG = Aware.getSetting(awareContext, Aware_Preferences.DEBUG_TAG).length() > 0 ? Aware.getSetting(awareContext, Aware_Preferences.DEBUG_TAG) : TAG; if (Aware.DEBUG) Log.d(TAG, "AWARE framework is active..."); //Boot AWARE services startAWARE(); if (Aware.getSetting(getApplicationContext(), Aware_Preferences.STATUS_WEBSERVICE).equals("true")) { int frequency_webservice = Integer.parseInt(Aware.getSetting(getApplicationContext(), Aware_Preferences.FREQUENCY_WEBSERVICE)); if (frequency_webservice == 0) { if (DEBUG) Log.d(TAG, "Data sync is disabled."); Scheduler.removeSchedule(getApplicationContext(), SCHEDULE_SYNC_DATA); } else { Scheduler.Schedule sync = Scheduler.getSchedule(this, SCHEDULE_SYNC_DATA); if (sync == null) { //Set the sync schedule for the first time try { Scheduler.Schedule schedule = new Scheduler.Schedule(SCHEDULE_SYNC_DATA) .setActionType(Scheduler.ACTION_TYPE_BROADCAST) .setActionClass(Aware.ACTION_AWARE_SYNC_DATA) .setInterval(frequency_webservice); Scheduler.saveSchedule(getApplicationContext(), schedule); if (DEBUG) { Log.d(TAG, "Data sync every " + schedule.getInterval() + " minute(s)"); } } catch (JSONException e) { e.printStackTrace(); } } else { //check the sync schedule for changes try { long interval = sync.getInterval(); if (interval != frequency_webservice) { Scheduler.Schedule schedule = new Scheduler.Schedule(SCHEDULE_SYNC_DATA) .setActionType(Scheduler.ACTION_TYPE_BROADCAST) .setActionClass(Aware.ACTION_AWARE_SYNC_DATA) .setInterval(frequency_webservice); Scheduler.saveSchedule(getApplicationContext(), schedule); if (DEBUG) { Log.d(TAG, "Data sync at " + schedule.getInterval() + " minute(s)"); } } } catch (JSONException e) { e.printStackTrace(); } } } } if (Aware.getSetting(getApplicationContext(), Aware_Preferences.FREQUENCY_CLEAN_OLD_DATA).length() > 0) { String[] frequency = new String[]{"never", "weekly", "monthly", "daily", "always"}; int frequency_space_maintenance = Integer.parseInt(Aware.getSetting(getApplicationContext(), Aware_Preferences.FREQUENCY_CLEAN_OLD_DATA)); if (DEBUG && frequency_space_maintenance != 0) Log.d(TAG, "Space maintenance is: " + frequency[frequency_space_maintenance]); try { if (frequency_space_maintenance == 0 || frequency_space_maintenance == 4) { //if always, we clear old data as soon as we upload to server Scheduler.removeSchedule(getApplicationContext(), SCHEDULE_SPACE_MAINTENANCE); } else { Scheduler.Schedule cleanup = new Scheduler.Schedule(SCHEDULE_SPACE_MAINTENANCE); switch (frequency_space_maintenance) { case 1: //weekly, by default every Sunday cleanup.addWeekday("Sunday") .setActionType(Scheduler.ACTION_TYPE_BROADCAST) .setActionClass(Aware.ACTION_AWARE_SPACE_MAINTENANCE); break; case 2: //monthly cleanup.addMonth("January") .addMonth("February") .addMonth("March") .addMonth("April") .addMonth("May") .addMonth("June") .addMonth("July") .addMonth("August") .addMonth("September") .addMonth("October") .addMonth("November") .addMonth("December") .setActionType(Scheduler.ACTION_TYPE_BROADCAST) .setActionClass(Aware.ACTION_AWARE_SPACE_MAINTENANCE); break; case 3: //daily cleanup.addWeekday("Monday") .addWeekday("Tuesday") .addWeekday("Wednesday") .addWeekday("Thursday") .addWeekday("Friday") .addWeekday("Saturday") .addWeekday("Sunday") .setActionType(Scheduler.ACTION_TYPE_BROADCAST) .setActionClass(Aware.ACTION_AWARE_SPACE_MAINTENANCE); break; } Scheduler.saveSchedule(getApplicationContext(), cleanup); } } catch (JSONException e) { e.printStackTrace(); } } //Get the active plugins ArrayList<String> active_plugins = new ArrayList<>(); Cursor enabled_plugins = getContentResolver().query(Aware_Plugins.CONTENT_URI, null, Aware_Plugins.PLUGIN_STATUS + "=" + Aware_Plugin.STATUS_PLUGIN_ON, null, null); if (enabled_plugins != null && enabled_plugins.moveToFirst()) { do { String package_name = enabled_plugins.getString(enabled_plugins.getColumnIndex(Aware_Plugins.PLUGIN_PACKAGE_NAME)); active_plugins.add(package_name); } while (enabled_plugins.moveToNext()); } if (enabled_plugins != null && !enabled_plugins.isClosed()) enabled_plugins.close(); if (active_plugins.size() > 0) { for (String package_name : active_plugins) { startPlugin(getApplicationContext(), package_name); } } } else { //Turn off all enabled plugins and services stopAWARE(); ArrayList<String> active_plugins = new ArrayList<>(); Cursor enabled_plugins = getContentResolver().query(Aware_Plugins.CONTENT_URI, null, Aware_Plugins.PLUGIN_STATUS + "=" + Aware_Plugin.STATUS_PLUGIN_ON, null, null); if (enabled_plugins != null && enabled_plugins.moveToFirst()) { do { String package_name = enabled_plugins.getString(enabled_plugins.getColumnIndex(Aware_Plugins.PLUGIN_PACKAGE_NAME)); active_plugins.add(package_name); } while (enabled_plugins.moveToNext()); } if (enabled_plugins != null && !enabled_plugins.isClosed()) enabled_plugins.close(); if (active_plugins.size() > 0) { for (String package_name : active_plugins) { stopPlugin(getApplicationContext(), package_name); } if (Aware.DEBUG) Log.w(TAG, "AWARE plugins disabled..."); } } return START_STICKY; } /** * Stops a plugin. Expects the package name of the plugin. * * @param context * @param package_name */ public static void stopPlugin(final Context context, final String package_name) { if (awareContext == null) awareContext = context; //Check if plugin is bundled within an application/plugin Intent bundled = new Intent(); bundled.setComponent(new ComponentName(context.getPackageName(), package_name + ".Plugin")); boolean result = context.stopService(bundled); if (result) { ContentValues rowData = new ContentValues(); rowData.put(Aware_Plugins.PLUGIN_STATUS, Aware_Plugin.STATUS_PLUGIN_OFF); context.getContentResolver().update(Aware_Plugins.CONTENT_URI, rowData, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + package_name + "'", null); return; } boolean is_installed = false; Cursor cached = context.getContentResolver().query(Aware_Plugins.CONTENT_URI, null, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + package_name + "'", null, null); if (cached != null && cached.moveToFirst()) { is_installed = true; } if (cached != null && !cached.isClosed()) cached.close(); if (is_installed) { Intent plugin = new Intent(); plugin.setComponent(new ComponentName(package_name, package_name + ".Plugin")); context.stopService(plugin); } ContentValues rowData = new ContentValues(); rowData.put(Aware_Plugins.PLUGIN_STATUS, Aware_Plugin.STATUS_PLUGIN_OFF); context.getContentResolver().update(Aware_Plugins.CONTENT_URI, rowData, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + package_name + "'", null); } /** * Starts a plugin. Expects the package name of the plugin. * It checks if the plugin does exist on the phone. If it doesn't, it will request the user to install it automatically. * * @param context * @param package_name */ public static void startPlugin(final Context context, final String package_name) { if (awareContext == null) awareContext = context; //Check if plugin is bundled within an application/plugin Intent bundled = new Intent(); bundled.setComponent(new ComponentName(context.getPackageName(), package_name + ".Plugin")); ComponentName bundledResult = context.startService(bundled); if (bundledResult != null) { if (Aware.DEBUG) Log.d(TAG, "Bundled " + package_name + ".Plugin started..."); //Check if plugin is cached Cursor cached = context.getContentResolver().query(Aware_Plugins.CONTENT_URI, null, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + package_name + "'", null, null); if (cached == null || !cached.moveToFirst()) { //Fixed: add the bundled plugin to the list of installed plugins on the self-contained apps ContentValues rowData = new ContentValues(); rowData.put(Aware_Plugins.PLUGIN_AUTHOR, "Self-packaged"); rowData.put(Aware_Plugins.PLUGIN_DESCRIPTION, "Bundled with " + context.getPackageName()); rowData.put(Aware_Plugins.PLUGIN_NAME, "Self-packaged"); rowData.put(Aware_Plugins.PLUGIN_PACKAGE_NAME, package_name); rowData.put(Aware_Plugins.PLUGIN_STATUS, Aware_Plugin.STATUS_PLUGIN_ON); rowData.put(Aware_Plugins.PLUGIN_VERSION, 1); context.getContentResolver().insert(Aware_Plugins.CONTENT_URI, rowData); if (Aware.DEBUG) Log.d(TAG, "Added self-package " + package_name + " to " + context.getPackageName()); } if (cached != null && !cached.isClosed()) cached.close(); } //Check if plugin is cached Cursor cached = context.getContentResolver().query(Aware_Plugins.CONTENT_URI, null, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + package_name + "'", null, null); if (cached != null && cached.moveToFirst()) { //Installed on the phone if (isClassAvailable(context, package_name, "Plugin")) { Intent plugin = new Intent(); plugin.setComponent(new ComponentName(package_name, package_name + ".Plugin")); ComponentName cachedResult = context.startService(plugin); if (cachedResult != null) { if (Aware.DEBUG) Log.d(TAG, package_name + " started..."); ContentValues rowData = new ContentValues(); rowData.put(Aware_Plugins.PLUGIN_STATUS, Aware_Plugin.STATUS_PLUGIN_ON); context.getContentResolver().update(Aware_Plugins.CONTENT_URI, rowData, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + package_name + "'", null); } } } if (cached != null && !cached.isClosed()) cached.close(); } /** * Requests the download of a plugin given the package name from AWARE webservices or the Play Store otherwise * * @param context * @param package_name * @param is_update */ public static void downloadPlugin(Context context, String package_name, boolean is_update) { Intent pluginIntent = new Intent(context, DownloadPluginService.class); pluginIntent.putExtra("package_name", package_name); pluginIntent.putExtra("is_update", is_update); context.startService(pluginIntent); } /** * Given a plugin's package name, fetch the context card for reuse. * * @param context: application context * @param package_name: plugin's package name * @return View for reuse (instance of LinearLayout) */ public static View getContextCard(final Context context, final String package_name) { if (!isClassAvailable(context, package_name, "ContextCard")) { Log.d(TAG, "No ContextCard: " + package_name); return null; } String ui_class = package_name + ".ContextCard"; try { Context packageContext = context.createPackageContext(package_name, Context.CONTEXT_INCLUDE_CODE + Context.CONTEXT_IGNORE_SECURITY); Class<?> fragment_loader = packageContext.getClassLoader().loadClass(ui_class); Object fragment = fragment_loader.newInstance(); Method[] allMethods = fragment_loader.getDeclaredMethods(); Method m = null; for (Method mItem : allMethods) { String mName = mItem.getName(); if (mName.contains("getContextCard")) { mItem.setAccessible(true); m = mItem; break; } } View ui = (View) m.invoke(fragment, packageContext); if (ui != null) { ui.setBackgroundColor(Color.WHITE); ui.setPadding(0, 0, 0, 10); LinearLayout card = new LinearLayout(context); LinearLayout.LayoutParams card_params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); card.setLayoutParams(card_params); card.setOrientation(LinearLayout.VERTICAL); LinearLayout info = new LinearLayout(context); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1f); info.setLayoutParams(params); info.setOrientation(LinearLayout.HORIZONTAL); info.setBackgroundColor(Color.parseColor("#33B5E5")); TextView plugin_header = new TextView(context); plugin_header.setText(PluginsManager.getPluginName(context, package_name)); plugin_header.setTextColor(Color.WHITE); plugin_header.setPadding(10, 0, 0, 0); params.gravity = android.view.Gravity.CENTER_VERTICAL; plugin_header.setLayoutParams(params); info.addView(plugin_header); //Check if plugin has settings. Add button if it does. if (isClassAvailable(context, package_name, "Settings")) { ImageView infoSettings = new ImageView(context); infoSettings.setBackgroundResource(R.drawable.ic_action_plugin_settings); infoSettings.setAdjustViewBounds(true); infoSettings.setMaxWidth(10); infoSettings.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent open_settings = new Intent(); open_settings.setComponent(new ComponentName(package_name, package_name + ".Settings")); open_settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(open_settings); } }); info.addView(infoSettings); //Add settings shortcut to card card.addView(info); } //Add inflated UI to card card.addView(ui); return card; } else { return null; } } catch (NameNotFoundException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } return null; } /** * Given a package and class name, check if the class exists or not. * * @param package_name * @param class_name * @return true if exists, false otherwise */ public static boolean isClassAvailable(Context context, String package_name, String class_name) { try { Context package_context = context.createPackageContext(package_name, Context.CONTEXT_IGNORE_SECURITY + Context.CONTEXT_INCLUDE_CODE); DexFile df = new DexFile(package_context.getPackageCodePath()); for (Enumeration<String> iter = df.entries(); iter.hasMoreElements(); ) { String className = iter.nextElement(); if (className.contains(class_name)) return true; } return false; } catch (IOException | NameNotFoundException e) { return false; } } /** * Retrieve setting value given key. * * @param key * @return value */ public static String getSetting(Context context, String key) { boolean is_global; ArrayList<String> global_settings = new ArrayList<String>(); global_settings.add(Aware_Preferences.DEBUG_FLAG); global_settings.add(Aware_Preferences.DEBUG_TAG); global_settings.add(Aware.STUDY_ID); global_settings.add(Aware.STUDY_START); global_settings.add(Aware_Preferences.DEVICE_ID); global_settings.add(Aware_Preferences.DEVICE_LABEL); global_settings.add(Aware_Preferences.STATUS_WEBSERVICE); global_settings.add(Aware_Preferences.FREQUENCY_WEBSERVICE); global_settings.add(Aware_Preferences.WEBSERVICE_WIFI_ONLY); global_settings.add(Aware_Preferences.WEBSERVICE_SERVER); global_settings.add(Aware_Preferences.STATUS_APPLICATIONS); global_settings.add(Applications.STATUS_AWARE_ACCESSIBILITY); //allow plugin's to react to MQTT global_settings.add(Aware_Preferences.STATUS_MQTT); global_settings.add(Aware_Preferences.MQTT_USERNAME); global_settings.add(Aware_Preferences.MQTT_PASSWORD); global_settings.add(Aware_Preferences.MQTT_SERVER); global_settings.add(Aware_Preferences.MQTT_PORT); global_settings.add(Aware_Preferences.MQTT_PROTOCOL); global_settings.add(Aware_Preferences.MQTT_KEEP_ALIVE); global_settings.add(Aware_Preferences.MQTT_QOS); is_global = global_settings.contains(key); String value = ""; Cursor qry = context.getContentResolver().query(Aware_Settings.CONTENT_URI, null, Aware_Settings.SETTING_KEY + " LIKE '" + key + "' AND " + Aware_Settings.SETTING_PACKAGE_NAME + " LIKE " + ((is_global) ? "'com.aware.phone'" : "'" + context.getPackageName() + "'") + ((is_global) ? " OR " + Aware_Settings.SETTING_PACKAGE_NAME + " LIKE ''" : ""), null, null); if (qry != null && qry.moveToFirst()) { value = qry.getString(qry.getColumnIndex(Aware_Settings.SETTING_VALUE)); } if (qry != null && !qry.isClosed()) qry.close(); return value; } /** * Retrieve setting value given a key of a plugin's settings * * @param context * @param key * @param package_name * @return value */ public static String getSetting(Context context, String key, String package_name) { String value = ""; Cursor qry = context.getContentResolver().query(Aware_Settings.CONTENT_URI, null, Aware_Settings.SETTING_KEY + " LIKE '" + key + "' AND " + Aware_Settings.SETTING_PACKAGE_NAME + " LIKE '" + package_name + "'", null, null); if (qry != null && qry.moveToFirst()) { value = qry.getString(qry.getColumnIndex(Aware_Settings.SETTING_VALUE)); } if (qry != null && !qry.isClosed()) qry.close(); return value; } /** * Insert / Update settings of the framework * * @param key * @param value */ public static void setSetting(Context context, String key, Object value) { boolean is_global; ArrayList<String> global_settings = new ArrayList<String>(); global_settings.add(Aware_Preferences.DEBUG_FLAG); global_settings.add(Aware_Preferences.DEBUG_TAG); global_settings.add(Aware.STUDY_ID); global_settings.add(Aware.STUDY_START); global_settings.add(Aware_Preferences.DEVICE_ID); global_settings.add(Aware_Preferences.DEVICE_LABEL); global_settings.add(Aware_Preferences.STATUS_WEBSERVICE); global_settings.add(Aware_Preferences.FREQUENCY_WEBSERVICE); global_settings.add(Aware_Preferences.WEBSERVICE_WIFI_ONLY); global_settings.add(Aware_Preferences.WEBSERVICE_SERVER); global_settings.add(Applications.STATUS_AWARE_ACCESSIBILITY); //allow plugins to get accessibility events global_settings.add(Aware_Preferences.STATUS_APPLICATIONS); //allow plugin's to react to MQTT global_settings.add(Aware_Preferences.STATUS_MQTT); global_settings.add(Aware_Preferences.MQTT_USERNAME); global_settings.add(Aware_Preferences.MQTT_PASSWORD); global_settings.add(Aware_Preferences.MQTT_SERVER); global_settings.add(Aware_Preferences.MQTT_PORT); global_settings.add(Aware_Preferences.MQTT_PROTOCOL); global_settings.add(Aware_Preferences.MQTT_KEEP_ALIVE); global_settings.add(Aware_Preferences.MQTT_QOS); is_global = global_settings.contains(key); //We already have a Device ID or Group ID, bail-out! if (key.equals(Aware_Preferences.DEVICE_ID) && Aware.getSetting(context, Aware_Preferences.DEVICE_ID).length() > 0) return; if (key.equals(Aware_Preferences.DEVICE_LABEL) && Aware.getSetting(context, Aware_Preferences.DEVICE_LABEL).length() > 0) return; ContentValues setting = new ContentValues(); setting.put(Aware_Settings.SETTING_KEY, key); setting.put(Aware_Settings.SETTING_VALUE, value.toString()); if (is_global) { setting.put(Aware_Settings.SETTING_PACKAGE_NAME, "com.aware.phone"); } else { setting.put(Aware_Settings.SETTING_PACKAGE_NAME, context.getPackageName()); } Cursor qry = context.getContentResolver().query(Aware_Settings.CONTENT_URI, null, Aware_Settings.SETTING_KEY + " LIKE '" + key + "' AND " + Aware_Settings.SETTING_PACKAGE_NAME + " LIKE " + ((is_global) ? "'com.aware.phone'" : "'" + context.getPackageName() + "'"), null, null); //update if (qry != null && qry.moveToFirst()) { try { if (!qry.getString(qry.getColumnIndex(Aware_Settings.SETTING_VALUE)).equals(value.toString())) { context.getContentResolver().update(Aware_Settings.CONTENT_URI, setting, Aware_Settings.SETTING_ID + "=" + qry.getInt(qry.getColumnIndex(Aware_Settings.SETTING_ID)), null); if (Aware.DEBUG) Log.d(Aware.TAG, "Updated: " + key + "=" + value); } } catch (SQLiteException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } catch (SQLException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } //insert } else { try { context.getContentResolver().insert(Aware_Settings.CONTENT_URI, setting); if (Aware.DEBUG) Log.d(Aware.TAG, "Added: " + key + "=" + value); } catch (SQLiteException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } catch (SQLException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } } if (qry != null && !qry.isClosed()) qry.close(); } /** * Insert / Update settings of a plugin * * @param key * @param value * @param package_name */ public static void setSetting(Context context, String key, Object value, String package_name) { //We already have a device ID, bail-out! if (key.equals(Aware_Preferences.DEVICE_ID) && Aware.getSetting(context, Aware_Preferences.DEVICE_ID).length() > 0) return; ContentValues setting = new ContentValues(); setting.put(Aware_Settings.SETTING_KEY, key); setting.put(Aware_Settings.SETTING_VALUE, value.toString()); setting.put(Aware_Settings.SETTING_PACKAGE_NAME, package_name); Cursor qry = context.getContentResolver().query(Aware_Settings.CONTENT_URI, null, Aware_Settings.SETTING_KEY + " LIKE '" + key + "' AND " + Aware_Settings.SETTING_PACKAGE_NAME + " LIKE '" + package_name + "'", null, null); //update if (qry != null && qry.moveToFirst()) { try { if (!qry.getString(qry.getColumnIndex(Aware_Settings.SETTING_VALUE)).equals(value.toString())) { context.getContentResolver().update(Aware_Settings.CONTENT_URI, setting, Aware_Settings.SETTING_ID + "=" + qry.getInt(qry.getColumnIndex(Aware_Settings.SETTING_ID)), null); if (Aware.DEBUG) Log.d(Aware.TAG, "Updated: " + key + "=" + value + " in " + package_name); } } catch (SQLiteException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } catch (SQLException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } //insert } else { try { context.getContentResolver().insert(Aware_Settings.CONTENT_URI, setting); if (Aware.DEBUG) Log.d(Aware.TAG, "Added: " + key + "=" + value + " in " + package_name); } catch (SQLiteException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } catch (SQLException e) { if (Aware.DEBUG) Log.d(TAG, e.getMessage()); } } if (qry != null && !qry.isClosed()) qry.close(); } /** * Allows self-contained apps to join a study * * @param context * @param study_url */ public static void joinStudy(Context context, String study_url) { Intent join = new Intent(context, JoinStudy.class); join.putExtra(StudyUtils.EXTRA_JOIN_STUDY, study_url); context.startService(join); } /** * Allows the dashboard to modify unitary settings for tweaking a configuration for devices. * * @param c * @param configs */ protected static void tweakSettings(Context c, JSONArray configs) { //Apply study settings JSONArray plugins = new JSONArray(); JSONArray sensors = new JSONArray(); for (int i = 0; i < configs.length(); i++) { try { JSONObject element = configs.getJSONObject(i); if (element.has("plugins")) { plugins = element.getJSONArray("plugins"); } if (element.has("sensors")) { sensors = element.getJSONArray("sensors"); } } catch (JSONException e) { e.printStackTrace(); } } //Set the sensors' settings first for (int i = 0; i < sensors.length(); i++) { try { JSONObject sensor_config = sensors.getJSONObject(i); Aware.setSetting(c, sensor_config.getString("setting"), sensor_config.get("value"), "com.aware.phone"); } catch (JSONException e) { e.printStackTrace(); } } for (int i = 0; i < plugins.length(); i++) { try { JSONObject plugin_config = plugins.getJSONObject(i); String package_name = plugin_config.getString("plugin"); JSONArray plugin_settings = plugin_config.getJSONArray("settings"); for (int j = 0; j < plugin_settings.length(); j++) { JSONObject plugin_setting = plugin_settings.getJSONObject(j); Aware.setSetting(c, plugin_setting.getString("setting"), plugin_setting.get("value"), package_name); } } catch (JSONException e) { e.printStackTrace(); } } Intent apply = new Intent(Aware.ACTION_AWARE_REFRESH); c.sendBroadcast(apply); } /** * Used by self-contained apps to join a study */ public static class JoinStudy extends StudyUtils { @Override protected void onHandleIntent(Intent intent) { String study_url = intent.getStringExtra(EXTRA_JOIN_STUDY); if (Aware.DEBUG) Log.d(Aware.TAG, "Joining: " + study_url); //Request study settings Hashtable<String, String> data = new Hashtable<>(); data.put(Aware_Preferences.DEVICE_ID, Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID)); String protocol = study_url.substring(0, study_url.indexOf(":")); String answer; if (protocol.equals("https")) { //Make sure we have the server's certificates for security Intent ssl = new Intent(getApplicationContext(), SSLManager.class); ssl.putExtra(SSLManager.EXTRA_SERVER, study_url); startService(ssl); try { answer = new Https(getApplicationContext(), SSLManager.getHTTPS(getApplicationContext(), study_url)).dataPOST(study_url, data, true); } catch (FileNotFoundException e) { answer = null; } } else { answer = new Http(getApplicationContext()).dataPOST(study_url, data, true); } if (answer == null) { Toast.makeText(getApplicationContext(), "Failed to connect to server, try again.", Toast.LENGTH_LONG).show(); return; } try { JSONArray configs = new JSONArray(answer); if (configs.getJSONObject(0).has("message")) { Toast.makeText(getApplicationContext(), "This study is no longer available.", Toast.LENGTH_LONG).show(); return; } //Apply study settings JSONArray plugins = new JSONArray(); JSONArray sensors = new JSONArray(); for (int i = 0; i < configs.length(); i++) { try { JSONObject element = configs.getJSONObject(i); if (element.has("plugins")) { plugins = element.getJSONArray("plugins"); } if (element.has("sensors")) { sensors = element.getJSONArray("sensors"); } } catch (JSONException e) { e.printStackTrace(); } } //Set the sensors' settings first for (int i = 0; i < sensors.length(); i++) { try { JSONObject sensor_config = sensors.getJSONObject(i); Aware.setSetting(getApplicationContext(), sensor_config.getString("setting"), sensor_config.get("value"), "com.aware.phone"); } catch (JSONException e) { e.printStackTrace(); } } //Set the plugins' settings now ArrayList<String> active_plugins = new ArrayList<>(); for (int i = 0; i < plugins.length(); i++) { try { JSONObject plugin_config = plugins.getJSONObject(i); String package_name = plugin_config.getString("plugin"); active_plugins.add(package_name); JSONArray plugin_settings = plugin_config.getJSONArray("settings"); for (int j = 0; j < plugin_settings.length(); j++) { JSONObject plugin_setting = plugin_settings.getJSONObject(j); Aware.setSetting(getApplicationContext(), plugin_setting.getString("setting"), plugin_setting.get("value"), package_name); } } catch (JSONException e) { e.printStackTrace(); } } //Start bundled plugins for (String p : active_plugins) { Aware.startPlugin(getApplicationContext(), p); } } catch (JSONException e) { e.printStackTrace(); } //Send data to server for the first time, so that this device is immediately visible on the dashboard Intent sync = new Intent(Aware.ACTION_AWARE_SYNC_DATA); sendBroadcast(sync); Intent applyNew = new Intent(Aware.ACTION_AWARE_REFRESH); sendBroadcast(applyNew); } } @Override public void onDestroy() { super.onDestroy(); if (repeatingIntent != null) alarmManager.cancel(repeatingIntent); try { awareContext.unregisterReceiver(aware_BR); awareContext.unregisterReceiver(storage_BR); awareContext.unregisterReceiver(awareBoot); } catch (IllegalArgumentException e) { //There is no API to check if a broadcast receiver already is registered. Since Aware.java is shared accross plugins, the receiver is only registered on the client, not the plugins. } } public static void reset(Context c) { String device_id = Aware.getSetting(c, Aware_Preferences.DEVICE_ID); String device_label = Aware.getSetting(c, Aware_Preferences.DEVICE_LABEL); //Remove all settings c.getContentResolver().delete(Aware_Settings.CONTENT_URI, null, null); c.getContentResolver().delete(Scheduler_Provider.Scheduler_Data.CONTENT_URI, null, null); //Read default client settings SharedPreferences prefs = c.getSharedPreferences(c.getPackageName(), Context.MODE_PRIVATE); PreferenceManager.setDefaultValues(c, c.getPackageName(), Context.MODE_PRIVATE, R.xml.aware_preferences, true); prefs.edit().commit(); Map<String, ?> defaults = prefs.getAll(); for (Map.Entry<String, ?> entry : defaults.entrySet()) { Aware.setSetting(c, entry.getKey(), entry.getValue(), "com.aware.phone"); } //Keep previous AWARE Device ID and label Aware.setSetting(c, Aware_Preferences.DEVICE_ID, device_id); Aware.setSetting(c, Aware_Preferences.DEVICE_LABEL, device_label); ContentValues update_label = new ContentValues(); update_label.put(Aware_Device.LABEL, device_label); c.getContentResolver().update(Aware_Device.CONTENT_URI, update_label, Aware_Device.DEVICE_ID + " LIKE '" + device_id + "'", null); //Turn off all active plugins ArrayList<String> active_plugins = new ArrayList<>(); Cursor enabled_plugins = c.getContentResolver().query(Aware_Plugins.CONTENT_URI, null, Aware_Plugins.PLUGIN_STATUS + "=" + Aware_Plugin.STATUS_PLUGIN_ON, null, null); if (enabled_plugins != null && enabled_plugins.moveToFirst()) { do { String package_name = enabled_plugins.getString(enabled_plugins.getColumnIndex(Aware_Plugins.PLUGIN_PACKAGE_NAME)); active_plugins.add(package_name); } while (enabled_plugins.moveToNext()); } if (enabled_plugins != null && !enabled_plugins.isClosed()) enabled_plugins.close(); if (active_plugins.size() > 0) { for (String package_name : active_plugins) { stopPlugin(c, package_name); } if (Aware.DEBUG) Log.w(TAG, "AWARE plugins disabled..."); } Intent applyNew = new Intent(Aware.ACTION_AWARE_REFRESH); c.sendBroadcast(applyNew); } /** * AWARE Android Package Monitor * 1) Checks if a package is a plugin or not * 2) Installs a plugin that was just downloaded * * @author denzilferreira */ public static class AndroidPackageMonitor extends BroadcastReceiver { private static PackageManager mPkgManager; @Override public void onReceive(Context context, Intent intent) { mPkgManager = context.getPackageManager(); Bundle extras = intent.getExtras(); Uri packageUri = intent.getData(); if (packageUri == null) return; String packageName = packageUri.getSchemeSpecificPart(); if (packageName == null) return; if (!packageName.matches("com.aware.plugin.*")) return; if (intent.getAction().equals(Intent.ACTION_PACKAGE_ADDED)) { //Updating a package if (extras.getBoolean(Intent.EXTRA_REPLACING)) { if (Aware.DEBUG) Log.d(TAG, packageName + " is updating!"); ContentValues rowData = new ContentValues(); rowData.put(Aware_Plugins.PLUGIN_VERSION, PluginsManager.getPluginVersion(context, packageName)); rowData.put(Aware_Plugins.PLUGIN_ICON, PluginsManager.getPluginIcon(context, packageName)); rowData.put(Aware_Plugins.PLUGIN_NAME, PluginsManager.getPluginName(context, packageName)); Cursor current_status = context.getContentResolver().query(Aware_Plugins.CONTENT_URI, new String[]{Aware_Plugins.PLUGIN_STATUS}, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + packageName + "'", null, null); if (current_status != null && current_status.moveToFirst()) { if (current_status.getInt(current_status.getColumnIndex(Aware_Plugins.PLUGIN_STATUS)) == PluginsManager.PLUGIN_UPDATED) { //was updated, set to active now rowData.put(Aware_Plugins.PLUGIN_STATUS, Aware_Plugin.STATUS_PLUGIN_ON); } current_status.close(); } context.getContentResolver().update(Aware_Plugins.CONTENT_URI, rowData, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + packageName + "'", null); //Start plugin Aware.startPlugin(context, packageName); return; } //Installing new try { ApplicationInfo app = mPkgManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA); ContentValues rowData = new ContentValues(); rowData.put(Aware_Plugins.PLUGIN_PACKAGE_NAME, app.packageName); rowData.put(Aware_Plugins.PLUGIN_NAME, app.loadLabel(awareContext.getPackageManager()).toString()); rowData.put(Aware_Plugins.PLUGIN_VERSION, PluginsManager.getPluginVersion(context, app.packageName)); rowData.put(Aware_Plugins.PLUGIN_STATUS, Aware_Plugin.STATUS_PLUGIN_ON); rowData.put(Aware_Plugins.PLUGIN_ICON, PluginsManager.getPluginIcon(context, app.packageName)); if (PluginsManager.isLocal(context, app.packageName)) { context.getContentResolver().update(Aware_Plugins.CONTENT_URI, rowData, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + app.packageName + "'", null); } else { context.getContentResolver().insert(Aware_Plugins.CONTENT_URI, rowData); } if (Aware.DEBUG) Log.d(TAG, "AWARE plugin added and activated:" + app.packageName); Aware.startPlugin(context, app.packageName); } catch (final NameNotFoundException e) { e.printStackTrace(); } } if (intent.getAction().equals(Intent.ACTION_PACKAGE_REMOVED)) { //Updating if (extras.getBoolean(Intent.EXTRA_REPLACING)) { //this is an update, bail out. return; } //clean-up settings & schedules context.getContentResolver().delete(Aware_Settings.CONTENT_URI, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + packageName + "'", null); context.getContentResolver().delete(Scheduler_Provider.Scheduler_Data.CONTENT_URI, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + packageName + "'", null); //Deleting context.getContentResolver().delete(Aware_Plugins.CONTENT_URI, Aware_Plugins.PLUGIN_PACKAGE_NAME + " LIKE '" + packageName + "'", null); if (Aware.DEBUG) Log.d(TAG, "AWARE plugin removed:" + packageName); } } } /** * BroadcastReceiver that monitors for AWARE framework actions: * - ACTION_AWARE_SYNC_DATA = upload data to remote webservice server. * - ACTION_AWARE_CLEAR_DATA = clears local device's AWARE modules databases. * - ACTION_AWARE_REFRESH - apply changes to the configuration. * - {}@link WifiManager#WIFI_STATE_CHANGED_ACTION} - when Wi-Fi is available to sync * * @author denzil */ private static final Aware_Broadcaster aware_BR = new Aware_Broadcaster(); public static class Aware_Broadcaster extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { //We are only synching the device information, not aware's settings and active plugins. String[] DATABASE_TABLES = Aware_Provider.DATABASE_TABLES; String[] TABLES_FIELDS = Aware_Provider.TABLES_FIELDS; Uri[] CONTEXT_URIS = new Uri[]{Aware_Device.CONTENT_URI}; if (intent.getAction().equals(Aware.ACTION_AWARE_SYNC_DATA) && Aware.getSetting(context, Aware_Preferences.STATUS_WEBSERVICE).equals("true")) { Intent webserviceHelper = new Intent(context, WebserviceHelper.class); webserviceHelper.setAction(WebserviceHelper.ACTION_AWARE_WEBSERVICE_SYNC_TABLE); webserviceHelper.putExtra(WebserviceHelper.EXTRA_TABLE, DATABASE_TABLES[0]); webserviceHelper.putExtra(WebserviceHelper.EXTRA_FIELDS, TABLES_FIELDS[0]); webserviceHelper.putExtra(WebserviceHelper.EXTRA_CONTENT_URI, CONTEXT_URIS[0].toString()); context.startService(webserviceHelper); } if (intent.getAction().equals(Aware.ACTION_AWARE_CLEAR_DATA)) { context.getContentResolver().delete(Aware_Provider.Aware_Device.CONTENT_URI, null, null); if (Aware.DEBUG) Log.d(TAG, "Cleared " + CONTEXT_URIS[0]); //Clear remotely if webservices are active if (Aware.getSetting(context, Aware_Preferences.STATUS_WEBSERVICE).equals("true")) { Intent webserviceHelper = new Intent(context, WebserviceHelper.class); webserviceHelper.setAction(WebserviceHelper.ACTION_AWARE_WEBSERVICE_CLEAR_TABLE); webserviceHelper.putExtra(WebserviceHelper.EXTRA_TABLE, DATABASE_TABLES[0]); context.startService(webserviceHelper); } } if (intent.getAction().equals(Aware.ACTION_QUIT_STUDY)) { Aware.reset(context); } if (intent.getAction().equals(Aware.ACTION_AWARE_REFRESH)) { Intent refresh = new Intent(context, com.aware.Aware.class); context.startService(refresh); } } } /** * Checks if we have access to the storage of the device. Turns off AWARE when we don't, turns it back on when available again. */ private static final Storage_Broadcaster storage_BR = new Storage_Broadcaster(); public static class Storage_Broadcaster extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_MEDIA_MOUNTED)) { if (Aware.DEBUG) Log.d(TAG, "Resuming AWARE data logging..."); } if (intent.getAction().equals(Intent.ACTION_MEDIA_UNMOUNTED)) { if (Aware.DEBUG) Log.w(TAG, "Stopping AWARE data logging until the SDCard is available again..."); } Intent aware = new Intent(context, Aware.class); context.startService(aware); } } /** * Checks if we still have the accessibility services active or not */ private static final AwareBoot awareBoot = new AwareBoot(); public static class AwareBoot extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Applications.isAccessibilityServiceActive(context); //This shows notification automatically if the accessibility services are off } } /** * Start active services */ public static void startAWARE() { if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_ESM).equals("true")) { startESM(awareContext); } else stopESM(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_APPLICATIONS).equals("true")) { startApplications(awareContext); } else stopApplications(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_ACCELEROMETER).equals("true")) { startAccelerometer(awareContext); } else stopAccelerometer(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_INSTALLATIONS).equals("true")) { startInstallations(awareContext); } else stopInstallations(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_LOCATION_GPS).equals("true") || Aware.getSetting(awareContext, Aware_Preferences.STATUS_LOCATION_NETWORK).equals("true")) { startLocations(awareContext); } else stopLocations(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_BLUETOOTH).equals("true")) { startBluetooth(awareContext); } else stopBluetooth(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_SCREEN).equals("true")) { startScreen(awareContext); } else stopScreen(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_BATTERY).equals("true")) { startBattery(awareContext); } else stopBattery(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_NETWORK_EVENTS).equals("true")) { startNetwork(awareContext); } else stopNetwork(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_NETWORK_TRAFFIC).equals("true")) { startTraffic(awareContext); } else stopTraffic(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_COMMUNICATION_EVENTS).equals("true") || Aware.getSetting(awareContext, Aware_Preferences.STATUS_CALLS).equals("true") || Aware.getSetting(awareContext, Aware_Preferences.STATUS_MESSAGES).equals("true")) { startCommunication(awareContext); } else stopCommunication(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_PROCESSOR).equals("true")) { startProcessor(awareContext); } else stopProcessor(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_TIMEZONE).equals("true")) { startTimeZone(awareContext); } else stopTimeZone(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_MQTT).equals("true")) { startMQTT(awareContext); } else stopMQTT(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_GYROSCOPE).equals("true")) { startGyroscope(awareContext); } else stopGyroscope(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_WIFI).equals("true")) { startWiFi(awareContext); } else stopWiFi(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_TELEPHONY).equals("true")) { startTelephony(awareContext); } else stopTelephony(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_ROTATION).equals("true")) { startRotation(awareContext); } else stopRotation(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_LIGHT).equals("true")) { startLight(awareContext); } else stopLight(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_PROXIMITY).equals("true")) { startProximity(awareContext); } else stopProximity(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_MAGNETOMETER).equals("true")) { startMagnetometer(awareContext); } else stopMagnetometer(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_BAROMETER).equals("true")) { startBarometer(awareContext); } else stopBarometer(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_GRAVITY).equals("true")) { startGravity(awareContext); } else stopGravity(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_LINEAR_ACCELEROMETER).equals("true")) { startLinearAccelerometer(awareContext); } else stopLinearAccelerometer(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_TEMPERATURE).equals("true")) { startTemperature(awareContext); } else stopTemperature(awareContext); if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_KEYBOARD).equals("true")) { startKeyboard(awareContext); } else stopKeyboard(awareContext); //Start task scheduler scheduler = new Intent(awareContext, Scheduler.class); awareContext.startService(scheduler); } /** * Stop all services */ public static void stopAWARE() { stopApplications(awareContext); stopAccelerometer(awareContext); stopBattery(awareContext); stopBluetooth(awareContext); stopCommunication(awareContext); stopLocations(awareContext); stopNetwork(awareContext); stopTraffic(awareContext); stopScreen(awareContext); stopProcessor(awareContext); stopMQTT(awareContext); stopGyroscope(awareContext); stopWiFi(awareContext); stopTelephony(awareContext); stopTimeZone(awareContext); stopRotation(awareContext); stopLight(awareContext); stopProximity(awareContext); stopMagnetometer(awareContext); stopBarometer(awareContext); stopGravity(awareContext); stopLinearAccelerometer(awareContext); stopTemperature(awareContext); stopESM(awareContext); stopInstallations(awareContext); stopKeyboard(awareContext); awareContext.stopService(scheduler); } /** * Start keyboard module */ public static void startKeyboard(Context context) { awareContext = context; if (keyboard == null) keyboard = new Intent(awareContext, Keyboard.class); awareContext.startService(keyboard); } /** * Stop keyboard module */ public static void stopKeyboard(Context context) { awareContext = context; if (keyboard != null) awareContext.stopService(keyboard); } /** * Start Applications module */ public static void startApplications(Context context) { awareContext = context; if (applicationsSrv == null) { applicationsSrv = new Intent(awareContext, Applications.class); } try { ComponentName service = awareContext.startService(applicationsSrv); } catch (RuntimeException e) { //Gingerbread and Jelly Bean complain when we start the service explicitly. In these, it is handled by the OS } } /** * Stop Applications module */ public static void stopApplications(Context context) { awareContext = context; if (applicationsSrv != null) { try { awareContext.stopService(applicationsSrv); } catch (RuntimeException e) { //Gingerbread and Jelly Bean complain when we stop the serive explicitly. In these, it is handled by the OS } } } /** * Start Installations module */ public static void startInstallations(Context context) { awareContext = context; if (installationsSrv == null) installationsSrv = new Intent(awareContext, Installations.class); awareContext.startService(installationsSrv); } /** * Stop Installations module */ public static void stopInstallations(Context context) { awareContext = context; if (installationsSrv != null) awareContext.stopService(installationsSrv); } /** * Start ESM module */ public static void startESM(Context context) { awareContext = context; if (esmSrv == null) esmSrv = new Intent(awareContext, ESM.class); awareContext.startService(esmSrv); } /** * Stop ESM module */ public static void stopESM(Context context) { awareContext = context; if (esmSrv != null) awareContext.stopService(esmSrv); } /** * Start Temperature module */ public static void startTemperature(Context context) { awareContext = context; if (temperatureSrv == null) temperatureSrv = new Intent(awareContext, Temperature.class); awareContext.startService(temperatureSrv); } /** * Stop Temperature module */ public static void stopTemperature(Context context) { awareContext = context; if (temperatureSrv != null) awareContext.stopService(temperatureSrv); } /** * Start Linear Accelerometer module */ public static void startLinearAccelerometer(Context context) { awareContext = context; if (linear_accelSrv == null) linear_accelSrv = new Intent(awareContext, LinearAccelerometer.class); awareContext.startService(linear_accelSrv); } /** * Stop Linear Accelerometer module */ public static void stopLinearAccelerometer(Context context) { awareContext = context; if (linear_accelSrv != null) awareContext.stopService(linear_accelSrv); } /** * Start Gravity module */ public static void startGravity(Context context) { awareContext = context; if (gravitySrv == null) gravitySrv = new Intent(awareContext, Gravity.class); awareContext.startService(gravitySrv); } /** * Stop Gravity module */ public static void stopGravity(Context context) { awareContext = context; if (gravitySrv != null) awareContext.stopService(gravitySrv); } /** * Start Barometer module */ public static void startBarometer(Context context) { awareContext = context; if (barometerSrv == null) barometerSrv = new Intent(awareContext, Barometer.class); awareContext.startService(barometerSrv); } /** * Stop Barometer module */ public static void stopBarometer(Context context) { awareContext = context; if (barometerSrv != null) awareContext.stopService(barometerSrv); } /** * Start Magnetometer module */ public static void startMagnetometer(Context context) { awareContext = context; if (magnetoSrv == null) magnetoSrv = new Intent(awareContext, Magnetometer.class); awareContext.startService(magnetoSrv); } /** * Stop Magnetometer module */ public static void stopMagnetometer(Context context) { awareContext = context; if (magnetoSrv != null) awareContext.stopService(magnetoSrv); } /** * Start Proximity module */ public static void startProximity(Context context) { awareContext = context; if (proximitySrv == null) proximitySrv = new Intent(awareContext, Proximity.class); awareContext.startService(proximitySrv); } /** * Stop Proximity module */ public static void stopProximity(Context context) { awareContext = context; if (proximitySrv != null) awareContext.stopService(proximitySrv); } /** * Start Light module */ public static void startLight(Context context) { awareContext = context; if (lightSrv == null) lightSrv = new Intent(awareContext, Light.class); awareContext.startService(lightSrv); } /** * Stop Light module */ public static void stopLight(Context context) { awareContext = context; if (lightSrv != null) awareContext.stopService(lightSrv); } /** * Start Rotation module */ public static void startRotation(Context context) { awareContext = context; if (rotationSrv == null) rotationSrv = new Intent(awareContext, Rotation.class); awareContext.startService(rotationSrv); } /** * Stop Rotation module */ public static void stopRotation(Context context) { awareContext = context; if (rotationSrv != null) awareContext.stopService(rotationSrv); } /** * Start the Telephony module */ public static void startTelephony(Context context) { awareContext = context; if (telephonySrv == null) telephonySrv = new Intent(awareContext, Telephony.class); awareContext.startService(telephonySrv); } /** * Stop the Telephony module */ public static void stopTelephony(Context context) { awareContext = context; if (telephonySrv != null) awareContext.stopService(telephonySrv); } /** * Start the WiFi module */ public static void startWiFi(Context context) { awareContext = context; if (wifiSrv == null) wifiSrv = new Intent(awareContext, WiFi.class); awareContext.startService(wifiSrv); } public static void stopWiFi(Context context) { awareContext = context; if (wifiSrv != null) awareContext.stopService(wifiSrv); } /** * Start the gyroscope module */ public static void startGyroscope(Context context) { awareContext = context; if (gyroSrv == null) gyroSrv = new Intent(awareContext, Gyroscope.class); awareContext.startService(gyroSrv); } /** * Stop the gyroscope module */ public static void stopGyroscope(Context context) { awareContext = context; if (gyroSrv != null) awareContext.stopService(gyroSrv); } /** * Start the accelerometer module */ public static void startAccelerometer(Context context) { awareContext = context; if (accelerometerSrv == null) accelerometerSrv = new Intent(awareContext, Accelerometer.class); awareContext.startService(accelerometerSrv); } /** * Stop the accelerometer module */ public static void stopAccelerometer(Context context) { awareContext = context; if (accelerometerSrv != null) awareContext.stopService(accelerometerSrv); } /** * Start the Processor module */ public static void startProcessor(Context context) { awareContext = context; if (processorSrv == null) processorSrv = new Intent(awareContext, Processor.class); awareContext.startService(processorSrv); } /** * Stop the Processor module */ public static void stopProcessor(Context context) { awareContext = context; if (processorSrv != null) awareContext.stopService(processorSrv); } /** * Start the locations module */ public static void startLocations(Context context) { awareContext = context; if (locationsSrv == null) locationsSrv = new Intent(awareContext, Locations.class); awareContext.startService(locationsSrv); } /** * Stop the locations module */ public static void stopLocations(Context context) { awareContext = context; if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_LOCATION_GPS).equals("false") && Aware.getSetting(awareContext, Aware_Preferences.STATUS_LOCATION_NETWORK).equals("false")) { if (locationsSrv != null) awareContext.stopService(locationsSrv); } } /** * Start the bluetooth module */ public static void startBluetooth(Context context) { awareContext = context; if (bluetoothSrv == null) bluetoothSrv = new Intent(awareContext, Bluetooth.class); awareContext.startService(bluetoothSrv); } /** * Stop the bluetooth module */ public static void stopBluetooth(Context context) { awareContext = context; if (bluetoothSrv != null) awareContext.stopService(bluetoothSrv); } /** * Start the screen module */ public static void startScreen(Context context) { awareContext = context; if (screenSrv == null) screenSrv = new Intent(awareContext, Screen.class); awareContext.startService(screenSrv); } /** * Stop the screen module */ public static void stopScreen(Context context) { awareContext = context; if (screenSrv != null) awareContext.stopService(screenSrv); } /** * Start battery module */ public static void startBattery(Context context) { awareContext = context; if (batterySrv == null) batterySrv = new Intent(awareContext, Battery.class); awareContext.startService(batterySrv); } /** * Stop battery module */ public static void stopBattery(Context context) { awareContext = context; if (batterySrv != null) awareContext.stopService(batterySrv); } /** * Start network module */ public static void startNetwork(Context context) { awareContext = context; if (networkSrv == null) networkSrv = new Intent(awareContext, Network.class); awareContext.startService(networkSrv); } /** * Stop network module */ public static void stopNetwork(Context context) { awareContext = context; if (networkSrv != null) awareContext.stopService(networkSrv); } /** * Start traffic module */ public static void startTraffic(Context context) { awareContext = context; if (trafficSrv == null) trafficSrv = new Intent(awareContext, Traffic.class); awareContext.startService(trafficSrv); } /** * Stop traffic module */ public static void stopTraffic(Context context) { awareContext = context; if (trafficSrv != null) awareContext.stopService(trafficSrv); } /** * Start the Timezone module */ public static void startTimeZone(Context context) { awareContext = context; if (timeZoneSrv == null) timeZoneSrv = new Intent(awareContext, Timezone.class); awareContext.startService(timeZoneSrv); } /** * Stop the Timezone module */ public static void stopTimeZone(Context context) { awareContext = context; if (timeZoneSrv != null) awareContext.stopService(timeZoneSrv); } /** * Start communication module */ public static void startCommunication(Context context) { awareContext = context; if (communicationSrv == null) communicationSrv = new Intent(awareContext, Communication.class); awareContext.startService(communicationSrv); } /** * Stop communication module */ public static void stopCommunication(Context context) { awareContext = context; if (Aware.getSetting(awareContext, Aware_Preferences.STATUS_COMMUNICATION_EVENTS).equals("false") && Aware.getSetting(awareContext, Aware_Preferences.STATUS_CALLS).equals("false") && Aware.getSetting(awareContext, Aware_Preferences.STATUS_MESSAGES).equals("false")) { if (communicationSrv != null) awareContext.stopService(communicationSrv); } } /** * Start MQTT module */ public static void startMQTT(Context context) { awareContext = context; if (mqttSrv == null) mqttSrv = new Intent(awareContext, Mqtt.class); awareContext.startService(mqttSrv); } /** * Stop MQTT module */ public static void stopMQTT(Context context) { awareContext = context; if (mqttSrv != null) awareContext.stopService(mqttSrv); } }
92452b9e4257a233b219d477cc1ac15b897e248f
5,811
java
Java
com.equalize.xpi.esr.mapping/src/com/equalize/xpi/esr/mapping/udf/library/FL_DynamicConfiguration.java
engswee/equalize-xpi-mapping
3a67368c40d0d27e7cffcc27332d39b6741168c9
[ "MIT" ]
2
2020-03-20T20:23:00.000Z
2021-06-08T11:17:13.000Z
com.equalize.xpi.esr.mapping/src/com/equalize/xpi/esr/mapping/udf/library/FL_DynamicConfiguration.java
engswee/equalize-xpi-mapping
3a67368c40d0d27e7cffcc27332d39b6741168c9
[ "MIT" ]
null
null
null
com.equalize.xpi.esr.mapping/src/com/equalize/xpi/esr/mapping/udf/library/FL_DynamicConfiguration.java
engswee/equalize-xpi-mapping
3a67368c40d0d27e7cffcc27332d39b6741168c9
[ "MIT" ]
3
2017-07-07T15:27:47.000Z
2017-10-13T12:02:56.000Z
45.046512
165
0.64877
1,003,277
package com.equalize.xpi.esr.mapping.udf.library; import com.sap.aii.mapping.api.*; import java.io.*; import java.util.*; import com.sap.aii.mappingtool.tf7.rt.*; import com.sap.aii.mapping.lookup.*; import java.lang.reflect.*; import com.sap.ide.esr.tools.mapping.core.LibraryMethod; import com.sap.ide.esr.tools.mapping.core.ExecutionType; import com.sap.ide.esr.tools.mapping.core.Argument; import com.sap.ide.esr.tools.mapping.core.Init; import com.sap.ide.esr.tools.mapping.core.Cleanup; public class FL_DynamicConfiguration { @Init(description="") public void init ( GlobalContainer container) throws StreamTransformationException{ } @Cleanup public void cleanup ( GlobalContainer container) throws StreamTransformationException{ } @LibraryMethod(title="setDynamicConfigGenericAttribute", description="Set dynamic configuration attribute", category="FL_DynCfg", type=ExecutionType.SINGLE_VALUE) public String setDynamicConfigGenericAttribute ( @Argument(title="Namespace") String namespace, @Argument(title="Attribute") String attribute, @Argument(title="Value") String value, Container container) throws StreamTransformationException{ // ---------------------------------------------------------- // Sets the attribute value in dynamic configuration // ---------------------------------------------------------- if (namespace.equals("") ) { throw new RuntimeException("Dynamic Configuration namespace not populated"); } if (attribute.equals("") ) { throw new RuntimeException("Dynamic Configuration attribute not populated"); } Map<String, Object> all = container.getInputHeader().getAll(); DynamicConfiguration conf = (DynamicConfiguration) all.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); if (conf != null) { // Key DynamicConfigurationKey dynCfgKey = DynamicConfigurationKey.create( namespace, attribute ); // Store in Dyn Config conf.put(dynCfgKey, value); return value; } else { //No dynamic configuration in test mode return value; } } @LibraryMethod(title="getDynamicConfigGenericAttribute", description="Get dynamic configuration attribute", category="FL_DynCfg", type=ExecutionType.SINGLE_VALUE) public String getDynamicConfigGenericAttribute ( @Argument(title="Namespace") String namespace, @Argument(title="Attribute") String attribute, Container container) throws StreamTransformationException{ // ---------------------------------------------------------- // Get the attribute value in dynamic configuration // ---------------------------------------------------------- if (namespace.equals("") ) { throw new RuntimeException("Dynamic Configuration namespace not populated"); } if (attribute.equals("") ) { throw new RuntimeException("Dynamic Configuration field not populated"); } Map<String, Object> all = container.getInputHeader().getAll(); DynamicConfiguration conf = (DynamicConfiguration) all.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); if (conf != null) { // Key DynamicConfigurationKey dynCfgKey = DynamicConfigurationKey.create( namespace, attribute ); // Get from Dyn Config return conf.get(dynCfgKey); } else { //No dynamic configuration in test mode return "Test Mode"; } } @LibraryMethod(title="setFilename", description="Set dynamic configuration filename", category="FL_DynCfg", type=ExecutionType.SINGLE_VALUE) public String setFilename ( @Argument(title="File name") String filename, Container container) throws StreamTransformationException{ // ---------------------------------------------------------- // Set filename value in dynamic configuration // ---------------------------------------------------------- return setDynamicConfigGenericAttribute ("http://sap.com/xi/XI/System/File", "FileName", filename, container); } @LibraryMethod(title="getFilename", description="Get dynamic configuration filename", category="FL_DynCfg", type=ExecutionType.SINGLE_VALUE) public String getFilename ( Container container) throws StreamTransformationException{ // ---------------------------------------------------------- // Get filename value in dynamic configuration // ---------------------------------------------------------- return getDynamicConfigGenericAttribute("http://sap.com/xi/XI/System/File", "FileName", container); } @LibraryMethod(title="setDirectory", description="Set dynamic configuration directory", category="FL_DynCfg", type=ExecutionType.SINGLE_VALUE) public String setDirectory ( @Argument(title="Directory") String directory, Container container) throws StreamTransformationException{ // ---------------------------------------------------------- // Set directory value in dynamic configuration // ---------------------------------------------------------- return setDynamicConfigGenericAttribute ("http://sap.com/xi/XI/System/File", "Directory", directory, container); } @LibraryMethod(title="getDirectory", description="Set dynamic configuration directory", category="FL_DynCfg", type=ExecutionType.SINGLE_VALUE) public String getDirectory ( Container container) throws StreamTransformationException{ // ---------------------------------------------------------- // Get directory value in dynamic configuration // ---------------------------------------------------------- return getDynamicConfigGenericAttribute("http://sap.com/xi/XI/System/File", "Directory", container); } public String getPIMessageID(Container container) throws StreamTransformationException { return container.getInputHeader().getMessageId(); } }
92452cd78c9de92346be8faee2b5ced3172817bf
616
java
Java
ntsiot-system/src/main/java/com/nts/iot/modules/miniApp/dto/HoseTenantDto.java
luolxb/tracker-server
74f81cc9e511c0bc75a98440d1fad2a25a827ce3
[ "Apache-2.0" ]
null
null
null
ntsiot-system/src/main/java/com/nts/iot/modules/miniApp/dto/HoseTenantDto.java
luolxb/tracker-server
74f81cc9e511c0bc75a98440d1fad2a25a827ce3
[ "Apache-2.0" ]
null
null
null
ntsiot-system/src/main/java/com/nts/iot/modules/miniApp/dto/HoseTenantDto.java
luolxb/tracker-server
74f81cc9e511c0bc75a98440d1fad2a25a827ce3
[ "Apache-2.0" ]
1
2021-12-20T07:54:15.000Z
2021-12-20T07:54:15.000Z
18.117647
52
0.61526
1,003,278
package com.nts.iot.modules.miniApp.dto; import java.io.Serializable; public class HoseTenantDto implements Serializable { private String name ; private String phone ; private String idCard ; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getIdCard() { return idCard; } public void setIdCard(String idCard) { this.idCard = idCard; } }
92452dc20fc6222c22e2dea6cbf127c40b532de7
2,440
java
Java
java/com/google/android/apps/authenticator/barcode/BarcodeConditionChecker.java
muharremkackin/google-authenticator-android
6f65e99fcbc9bbefdc3317c008345db595052a2b
[ "Apache-2.0" ]
1,572
2015-01-03T05:28:04.000Z
2022-03-29T09:45:32.000Z
java/com/google/android/apps/authenticator/barcode/BarcodeConditionChecker.java
muharremkackin/google-authenticator-android
6f65e99fcbc9bbefdc3317c008345db595052a2b
[ "Apache-2.0" ]
115
2015-01-03T09:00:12.000Z
2021-04-01T06:54:26.000Z
java/com/google/android/apps/authenticator/barcode/BarcodeConditionChecker.java
muharremkackin/google-authenticator-android
6f65e99fcbc9bbefdc3317c008345db595052a2b
[ "Apache-2.0" ]
548
2015-01-02T13:04:17.000Z
2022-03-28T06:36:04.000Z
36.41791
94
0.761066
1,003,279
/* * Copyright 2019 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.authenticator.barcode; import android.app.Activity; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import com.google.android.apps.authenticator.AuthenticatorApplication; import com.google.android.gms.common.GoogleApiAvailability; /** * A class contains functions for checking conditions before running the barcode scanner. */ public class BarcodeConditionChecker { /** * Verifies that Google Play services is installed and enabled on this device, and that the * version installed on this device is no older than the one required by this client. */ public boolean isGooglePlayServicesAvailable(Activity activity) { return GoogleApiAvailability.getInstance() .getApkVersion(activity.getApplicationContext()) >= 9200000; } /** * Returns whether the barcode detector is operational or not. */ public boolean getIsBarcodeDetectorOperational(Activity activity) { final AuthenticatorApplication application = (AuthenticatorApplication) activity.getApplicationContext(); return application.getBarcodeDetector() != null && application.getBarcodeDetector().isOperational(); } /** * Check if the device has low storage. */ public boolean isLowStorage(Activity activity) { IntentFilter lowStorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW); return activity.registerReceiver(null, lowStorageFilter) != null; } /** * Check if the device has any front or rear camera for the barcode scanner. */ public boolean isCameraAvailableOnDevice(Activity activity) { return activity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA) || activity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT); } }