test[storage]: record class test

This commit is contained in:
godotg
2023-09-19 21:15:48 +08:00
parent a8f795393e
commit 5bcb2ca877
4 changed files with 57 additions and 22 deletions
@@ -1,4 +1,16 @@
package com.zfoo.storage.util.lambda;
/*
* Copyright (C) 2020 The zfoo Authors
* 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.zfoo.storage.util;
import com.zfoo.protocol.util.FieldUtils;
import org.junit.Test;
@@ -1,8 +1,20 @@
package com.zfoo.storage.util.lambda;
/*
* Copyright (C) 2020 The zfoo Authors
* 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.zfoo.storage.util;
import com.zfoo.storage.resource.TeacherResource;
import com.zfoo.storage.util.LambdaUtils;
import com.zfoo.storage.util.function.Func1;
import com.zfoo.storage.util.lambda.LambdaMeta;
import org.junit.Test;
import java.io.Serializable;
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2020 The zfoo Authors
* 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.zfoo.storage.util;
import com.zfoo.storage.resource.StudentResource;
import com.zfoo.storage.util.function.Func1;
import org.junit.Test;
/**
* @author veione
*/
public class TestLambdaFunctionCache {
@Test
public void testFunctionCache() {
Func1<StudentResource, Object> nameFunc = StudentResource::getName;
System.out.println(LambdaUtils.getMethodName(nameFunc));
System.out.println(LambdaUtils.getMethodName(nameFunc));
}
}
@@ -1,19 +0,0 @@
package com.zfoo.storage.util.lambda;
import com.zfoo.storage.resource.StudentResource;
import com.zfoo.storage.util.LambdaUtils;
import com.zfoo.storage.util.function.Func1;
import org.junit.Test;
/**
* @author veione
*/
public class TestLambdaFunctionCache {
@Test
public void testFunctionCache() {
Func1<StudentResource, Object> nameFunc = StudentResource::getName;
System.out.println(LambdaUtils.getMethodName(nameFunc));
System.out.println(LambdaUtils.getMethodName(nameFunc));
}
}