web_backend_develope
			
			
		
		
							parent
							
								
									e48af410dd
								
							
						
					
					
						commit
						8616a39ff8
					
				@ -0,0 +1,76 @@
 | 
				
			|||||||
 | 
					package com.platform.test;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.junit.Test;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.platform.entities.MyFilesEntity;
 | 
				
			||||||
 | 
					import com.platform.entities.PreDataInfo;
 | 
				
			||||||
 | 
					import com.platform.utils.BeanCopy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class BeanCopyTest {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Test
 | 
				
			||||||
 | 
						public void testCopy() {
 | 
				
			||||||
 | 
							PreDataInfo preDataInfo = new PreDataInfo();
 | 
				
			||||||
 | 
							preDataInfo.setAreaCode("area");
 | 
				
			||||||
 | 
							preDataInfo.setCityName("setCityName");
 | 
				
			||||||
 | 
							preDataInfo.setDistrictName("setDistrictName");
 | 
				
			||||||
 | 
							preDataInfo.setSysCode(4);
 | 
				
			||||||
 | 
							preDataInfo.setSysName("sysName");
 | 
				
			||||||
 | 
							MyFilesEntity myfile = new MyFilesEntity();
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							BeanCopy.copyBean(preDataInfo, myfile, "id");
 | 
				
			||||||
 | 
							System.out.println(myfile.getSysName());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Test
 | 
				
			||||||
 | 
						public void testString() {
 | 
				
			||||||
 | 
							String id = "";
 | 
				
			||||||
 | 
							System.out.println(id.isEmpty());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Test
 | 
				
			||||||
 | 
						public void testIntOr() {
 | 
				
			||||||
 | 
							int tableScript = 0; // 1111
 | 
				
			||||||
 | 
							int res = tableScript | 1;
 | 
				
			||||||
 | 
							System.out.println(res);
 | 
				
			||||||
 | 
							System.out.println(Integer.toBinaryString(res));
 | 
				
			||||||
 | 
							System.out.println("----");
 | 
				
			||||||
 | 
							res = res | 2;
 | 
				
			||||||
 | 
							System.out.println(res);
 | 
				
			||||||
 | 
							System.out.println(Integer.toBinaryString(res));
 | 
				
			||||||
 | 
							System.out.println("--------");
 | 
				
			||||||
 | 
							int tableScript2 = 0; // 1111
 | 
				
			||||||
 | 
							res = tableScript2 | 2;
 | 
				
			||||||
 | 
							System.out.println(res);
 | 
				
			||||||
 | 
							System.out.println(Integer.toBinaryString(res));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Test
 | 
				
			||||||
 | 
						public  void testIntAnd() {
 | 
				
			||||||
 | 
							Integer[] num = new Integer[3];
 | 
				
			||||||
 | 
							num[0] = 2;
 | 
				
			||||||
 | 
							num[1] = 3;
 | 
				
			||||||
 | 
							num[2] = 0;
 | 
				
			||||||
 | 
							System.out.println(getTotalStatus(num));
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private String getTotalStatus(Integer[] numArr) {
 | 
				
			||||||
 | 
							Integer result = 1;
 | 
				
			||||||
 | 
							for (Integer integer : numArr) {
 | 
				
			||||||
 | 
								if (integer != 1) {
 | 
				
			||||||
 | 
									result = integer;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (result == 1) {
 | 
				
			||||||
 | 
								return String.valueOf(result);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							for (Integer integer : numArr) {
 | 
				
			||||||
 | 
								if (integer != 1) {
 | 
				
			||||||
 | 
									result = result & integer;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return String.valueOf(result);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					package com.platform.test;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.io.File;
 | 
				
			||||||
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class linuxTest {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public static void main(String[] args) {
 | 
				
			||||||
 | 
							List<String> paths = new ArrayList<String>();
 | 
				
			||||||
 | 
							List<String> rs = getallfile(paths, "/DefaultDescription_last");
 | 
				
			||||||
 | 
							for (String string : rs) {
 | 
				
			||||||
 | 
								System.out.println(string);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private static List<String> getallfile(List<String> ps, String path){
 | 
				
			||||||
 | 
							File f = new File(path);
 | 
				
			||||||
 | 
							ps.add(f.getAbsolutePath());
 | 
				
			||||||
 | 
							System.out.println(f.exists());
 | 
				
			||||||
 | 
							if (f.exists()) {
 | 
				
			||||||
 | 
								String[] subpaths = f.list();
 | 
				
			||||||
 | 
								if (null != subpaths) {
 | 
				
			||||||
 | 
									for (String tmppath : subpaths) {
 | 
				
			||||||
 | 
										getallfile(ps, f.getAbsolutePath()+"/"+tmppath);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return ps;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue