style: improve code style (#4702)
* cleanup imports * update copyrights * remove empty JavaDoc * add missing curly braces * fix whitespaces * fix lines longer than 175 characters Co-authored-by: Josephine Rueckert <jd.rueckert@googlemail.com>develop
parent
ed2b29337d
commit
2d0c434654
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine;
|
package org.terasology.engine;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
|
@ -43,7 +43,6 @@ import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A base class for unit test classes to inherit to run in a Terasology environment - with LWJGL set up and so forth
|
* A base class for unit test classes to inherit to run in a Terasology environment - with LWJGL set up and so forth
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class TerasologyTestingEnvironment {
|
public abstract class TerasologyTestingEnvironment {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(TerasologyTestingEnvironment.class);
|
private static final Logger logger = LoggerFactory.getLogger(TerasologyTestingEnvironment.class);
|
||||||
|
@ -60,7 +59,7 @@ public abstract class TerasologyTestingEnvironment {
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setupEnvironment(@TempDir Path tempHome) throws Exception {
|
public static void setupEnvironment(@TempDir Path tempHome) throws Exception {
|
||||||
PathManager.getInstance().useOverrideHomePath(tempHome);
|
PathManager.getInstance().useOverrideHomePath(tempHome);
|
||||||
Bullet.init(true,false);
|
Bullet.init(true, false);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create at least for each class a new headless environment as it is fast and prevents side effects
|
* Create at least for each class a new headless environment as it is fast and prevents side effects
|
||||||
|
@ -95,12 +94,15 @@ public abstract class TerasologyTestingEnvironment {
|
||||||
context.put(CharacterStateEventPositionMap.class, characterStateEventPositionMap);
|
context.put(CharacterStateEventPositionMap.class, characterStateEventPositionMap);
|
||||||
DirectionAndOriginPosRecorderList directionAndOriginPosRecorderList = new DirectionAndOriginPosRecorderList();
|
DirectionAndOriginPosRecorderList directionAndOriginPosRecorderList = new DirectionAndOriginPosRecorderList();
|
||||||
context.put(DirectionAndOriginPosRecorderList.class, directionAndOriginPosRecorderList);
|
context.put(DirectionAndOriginPosRecorderList.class, directionAndOriginPosRecorderList);
|
||||||
RecordAndReplaySerializer recordAndReplaySerializer = new RecordAndReplaySerializer(engineEntityManager, recordedEventStore, recordAndReplayUtils, characterStateEventPositionMap, directionAndOriginPosRecorderList, moduleManager, context.get(TypeRegistry.class));
|
RecordAndReplaySerializer recordAndReplaySerializer = new RecordAndReplaySerializer(engineEntityManager,
|
||||||
|
recordedEventStore, recordAndReplayUtils, characterStateEventPositionMap,
|
||||||
|
directionAndOriginPosRecorderList, moduleManager, context.get(TypeRegistry.class));
|
||||||
context.put(RecordAndReplaySerializer.class, recordAndReplaySerializer);
|
context.put(RecordAndReplaySerializer.class, recordAndReplaySerializer);
|
||||||
|
|
||||||
Path savePath = PathManager.getInstance().getSavePath("world1");
|
Path savePath = PathManager.getInstance().getSavePath("world1");
|
||||||
context.put(StorageManager.class, new ReadWriteStorageManager(savePath, moduleManager.getEnvironment(),
|
context.put(StorageManager.class, new ReadWriteStorageManager(savePath, moduleManager.getEnvironment(),
|
||||||
engineEntityManager, mockBlockManager, extraDataManager, recordAndReplaySerializer, recordAndReplayUtils, recordAndReplayCurrentStatus));
|
engineEntityManager, mockBlockManager, extraDataManager, recordAndReplaySerializer,
|
||||||
|
recordAndReplayUtils, recordAndReplayCurrentStatus));
|
||||||
|
|
||||||
ComponentSystemManager componentSystemManager = new ComponentSystemManager(context);
|
ComponentSystemManager componentSystemManager = new ComponentSystemManager(context);
|
||||||
context.put(ComponentSystemManager.class, componentSystemManager);
|
context.put(ComponentSystemManager.class, componentSystemManager);
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine;
|
package org.terasology.engine;
|
||||||
|
|
||||||
import org.terasology.gestalt.naming.Name;
|
import org.terasology.gestalt.naming.Name;
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class TestAutoConfig extends AutoConfig {
|
||||||
);
|
);
|
||||||
|
|
||||||
public final Setting<ImmutableList<Integer>> integerListSetting = setting(
|
public final Setting<ImmutableList<Integer>> integerListSetting = setting(
|
||||||
type(new TypeInfo<ImmutableList<Integer>>() {}),
|
type(new TypeInfo<ImmutableList<Integer>>() { }),
|
||||||
defaultValue(ImmutableList.of())
|
defaultValue(ImmutableList.of())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.testUtil;
|
package org.terasology.engine.testUtil;
|
||||||
|
|
||||||
|
@ -34,8 +21,6 @@ import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class WorldProviderCoreStub implements WorldProviderCore {
|
public class WorldProviderCoreStub implements WorldProviderCore {
|
||||||
|
|
||||||
private Map<Vector3ic, Block> blocks = Maps.newHashMap();
|
private Map<Vector3ic, Block> blocks = Maps.newHashMap();
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.world.propagation;
|
package org.terasology.engine.world.propagation;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
@ -26,8 +13,6 @@ import org.terasology.engine.world.block.BlockRegionc;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class StubPropagatorWorldView implements PropagatorWorldView {
|
public class StubPropagatorWorldView implements PropagatorWorldView {
|
||||||
private TObjectByteMap<Vector3ic> lightData = new TObjectByteHashMap<>();
|
private TObjectByteMap<Vector3ic> lightData = new TObjectByteHashMap<>();
|
||||||
private Map<Vector3ic, Block> blockData = Maps.newHashMap();
|
private Map<Vector3ic, Block> blockData = Maps.newHashMap();
|
||||||
|
|
|
@ -5,8 +5,6 @@ package org.terasology.unittest.stubs;
|
||||||
import org.terasology.engine.entitySystem.Component;
|
import org.terasology.engine.entitySystem.Component;
|
||||||
import org.terasology.engine.entitySystem.entity.EntityRef;
|
import org.terasology.engine.entitySystem.entity.EntityRef;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class EntityRefComponent implements Component {
|
public class EntityRefComponent implements Component {
|
||||||
|
|
||||||
public EntityRef entityRef = EntityRef.NULL;
|
public EntityRef entityRef = EntityRef.NULL;
|
||||||
|
|
|
@ -5,8 +5,6 @@ package org.terasology.unittest.stubs;
|
||||||
import org.terasology.engine.entitySystem.Component;
|
import org.terasology.engine.entitySystem.Component;
|
||||||
import org.terasology.engine.world.block.ForceBlockActive;
|
import org.terasology.engine.world.block.ForceBlockActive;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
@ForceBlockActive
|
@ForceBlockActive
|
||||||
public class ForceBlockActiveComponent implements Component {
|
public class ForceBlockActiveComponent implements Component {
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@ package org.terasology.unittest.stubs;
|
||||||
import org.joml.Vector3f;
|
import org.joml.Vector3f;
|
||||||
import org.terasology.engine.entitySystem.Component;
|
import org.terasology.engine.entitySystem.Component;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class GetterSetterComponent implements Component {
|
public class GetterSetterComponent implements Component {
|
||||||
public transient boolean getterUsed;
|
public transient boolean getterUsed;
|
||||||
public transient boolean setterUsed;
|
public transient boolean setterUsed;
|
||||||
|
|
|
@ -4,8 +4,6 @@ package org.terasology.unittest.stubs;
|
||||||
|
|
||||||
import org.terasology.engine.entitySystem.Component;
|
import org.terasology.engine.entitySystem.Component;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public final class IntegerComponent implements Component {
|
public final class IntegerComponent implements Component {
|
||||||
public int value;
|
public int value;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@ package org.terasology.unittest.stubs;
|
||||||
import org.terasology.engine.entitySystem.Component;
|
import org.terasology.engine.entitySystem.Component;
|
||||||
import org.terasology.reflection.MappedContainer;
|
import org.terasology.reflection.MappedContainer;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class MappedTypeComponent implements Component {
|
public class MappedTypeComponent implements Component {
|
||||||
|
|
||||||
public InnerType val = new InnerType();
|
public InnerType val = new InnerType();
|
||||||
|
|
|
@ -6,8 +6,6 @@ import org.terasology.engine.entitySystem.Component;
|
||||||
import org.terasology.engine.entitySystem.Owns;
|
import org.terasology.engine.entitySystem.Owns;
|
||||||
import org.terasology.engine.entitySystem.entity.EntityRef;
|
import org.terasology.engine.entitySystem.entity.EntityRef;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class OwnerComponent implements Component {
|
public class OwnerComponent implements Component {
|
||||||
@Owns
|
@Owns
|
||||||
public EntityRef child = EntityRef.NULL;
|
public EntityRef child = EntityRef.NULL;
|
||||||
|
|
|
@ -5,8 +5,6 @@ package org.terasology.unittest.stubs;
|
||||||
import org.terasology.engine.entitySystem.Component;
|
import org.terasology.engine.entitySystem.Component;
|
||||||
import org.terasology.engine.world.block.ForceBlockActive;
|
import org.terasology.engine.world.block.ForceBlockActive;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
@ForceBlockActive(retainUnalteredOnBlockChange = true)
|
@ForceBlockActive(retainUnalteredOnBlockChange = true)
|
||||||
public class RetainedOnBlockChangeComponent implements Component {
|
public class RetainedOnBlockChangeComponent implements Component {
|
||||||
public int value;
|
public int value;
|
||||||
|
|
|
@ -6,8 +6,6 @@ package org.terasology.unittest.stubs;
|
||||||
import org.terasology.engine.entitySystem.Component;
|
import org.terasology.engine.entitySystem.Component;
|
||||||
import org.terasology.engine.entitySystem.systems.internal.DoNotAutoRegister;
|
import org.terasology.engine.entitySystem.systems.internal.DoNotAutoRegister;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
@DoNotAutoRegister
|
@DoNotAutoRegister
|
||||||
public class UnsupportedTypeComponent implements Component {
|
public class UnsupportedTypeComponent implements Component {
|
||||||
public UnsupportedType value;
|
public UnsupportedType value;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2019 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.config.flexible;
|
package org.terasology.engine.config.flexible;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
@ -50,7 +37,7 @@ public class AutoConfigTest {
|
||||||
);
|
);
|
||||||
|
|
||||||
assertEquals(
|
assertEquals(
|
||||||
Sets.newHashSet(new TypeInfo<Setting<String>>() {}, new TypeInfo<Setting<ImmutableList<Integer>>>() {}),
|
Sets.newHashSet(new TypeInfo<Setting<String>>() { }, new TypeInfo<Setting<ImmutableList<Integer>>>() { }),
|
||||||
settingFields.stream().map(Field::getGenericType).map(TypeInfo::of).collect(Collectors.toSet())
|
settingFields.stream().map(Field::getGenericType).map(TypeInfo::of).collect(Collectors.toSet())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.config.flexible.constraints;
|
package org.terasology.engine.config.flexible.constraints;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Nested;
|
import org.junit.jupiter.api.Nested;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2015 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.documentation;
|
package org.terasology.documentation;
|
||||||
|
|
||||||
import com.google.common.collect.Multimaps;
|
import com.google.common.collect.Multimaps;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2015 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.documentation;
|
package org.terasology.documentation;
|
||||||
|
|
||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.documentation.apiScraper;
|
package org.terasology.documentation.apiScraper;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.documentation.apiScraper;
|
package org.terasology.documentation.apiScraper;
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.documentation.apiScraper;
|
package org.terasology.documentation.apiScraper;
|
||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.documentation.apiScraper.util;
|
package org.terasology.documentation.apiScraper.util;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
// Copyright 2021 The Terasology Foundation
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package org.terasology.engine;
|
package org.terasology.engine;
|
||||||
|
|
||||||
import ch.qos.logback.classic.Level;
|
import ch.qos.logback.classic.Level;
|
||||||
|
|
|
@ -52,8 +52,6 @@ import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
import static org.terasology.engine.entitySystem.entity.internal.EntityScope.CHUNK;
|
import static org.terasology.engine.entitySystem.entity.internal.EntityScope.CHUNK;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class PojoEntityManagerTest {
|
public class PojoEntityManagerTest {
|
||||||
|
|
||||||
private static Context context;
|
private static Context context;
|
||||||
|
|
|
@ -31,8 +31,6 @@ import java.util.List;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class PojoEventSystemTests {
|
public class PojoEventSystemTests {
|
||||||
|
|
||||||
ComponentLibrary compLibrary;
|
ComponentLibrary compLibrary;
|
||||||
|
|
|
@ -23,8 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class PojoPrefabManagerTest {
|
public class PojoPrefabManagerTest {
|
||||||
|
|
||||||
public static final String PREFAB_NAME = "unittest:myprefab";
|
public static final String PREFAB_NAME = "unittest:myprefab";
|
||||||
|
|
|
@ -44,8 +44,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class PrefabTest {
|
public class PrefabTest {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(PrefabTest.class);
|
private static final Logger logger = LoggerFactory.getLogger(PrefabTest.class);
|
||||||
|
|
|
@ -19,8 +19,6 @@ import org.terasology.reflection.reflect.ReflectionReflectFactory;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class ComponentMetadataTest {
|
public class ComponentMetadataTest {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
|
@ -4,15 +4,13 @@ package org.terasology.engine.entitySystem.metadata;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.terasology.gestalt.assets.ResourceUrn;
|
import org.terasology.gestalt.assets.ResourceUrn;
|
||||||
import org.terasology.unittest.stubs.OwnerComponent;
|
|
||||||
import org.terasology.reflection.copy.CopyStrategyLibrary;
|
import org.terasology.reflection.copy.CopyStrategyLibrary;
|
||||||
import org.terasology.reflection.reflect.ReflectFactory;
|
import org.terasology.reflection.reflect.ReflectFactory;
|
||||||
import org.terasology.reflection.reflect.ReflectionReflectFactory;
|
import org.terasology.reflection.reflect.ReflectionReflectFactory;
|
||||||
|
import org.terasology.unittest.stubs.OwnerComponent;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class FieldMetadataTest {
|
public class FieldMetadataTest {
|
||||||
|
|
||||||
private ReflectFactory factory = new ReflectionReflectFactory();
|
private ReflectFactory factory = new ReflectionReflectFactory();
|
||||||
|
@ -28,7 +26,8 @@ public class FieldMetadataTest {
|
||||||
@Test
|
@Test
|
||||||
public void testOwnsAnnotationCollectionProcessed() throws NoSuchMethodException {
|
public void testOwnsAnnotationCollectionProcessed() throws NoSuchMethodException {
|
||||||
ComponentMetadata<org.terasology.engine.entitySystem.metadata.OwnedCollectionComponent> classMetadata =
|
ComponentMetadata<org.terasology.engine.entitySystem.metadata.OwnedCollectionComponent> classMetadata =
|
||||||
new ComponentMetadata<>(new ResourceUrn("unittest:OwnedCollectionComponent"), org.terasology.engine.entitySystem.metadata.OwnedCollectionComponent.class, factory, copyStrategyLibrary);
|
new ComponentMetadata<>(new ResourceUrn("unittest:OwnedCollectionComponent"),
|
||||||
|
org.terasology.engine.entitySystem.metadata.OwnedCollectionComponent.class, factory, copyStrategyLibrary);
|
||||||
ComponentFieldMetadata metadata = classMetadata.getField("items");
|
ComponentFieldMetadata metadata = classMetadata.getField("items");
|
||||||
assertTrue(metadata.isOwnedReference());
|
assertTrue(metadata.isOwnedReference());
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,6 @@ import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
@Tag("TteTest")
|
@Tag("TteTest")
|
||||||
public class NetworkOwnershipTest extends TerasologyTestingEnvironment {
|
public class NetworkOwnershipTest extends TerasologyTestingEnvironment {
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class ComponentSerializerTest {
|
public class ComponentSerializerTest {
|
||||||
private static ModuleManager moduleManager;
|
private static ModuleManager moduleManager;
|
||||||
private ComponentSerializer componentSerializer;
|
private ComponentSerializer componentSerializer;
|
||||||
|
|
|
@ -46,8 +46,6 @@ import static org.mockito.Mockito.when;
|
||||||
import static org.terasology.engine.entitySystem.entity.internal.EntityScope.CHUNK;
|
import static org.terasology.engine.entitySystem.entity.internal.EntityScope.CHUNK;
|
||||||
import static org.terasology.engine.entitySystem.entity.internal.EntityScope.GLOBAL;
|
import static org.terasology.engine.entitySystem.entity.internal.EntityScope.GLOBAL;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class EntitySerializerTest {
|
public class EntitySerializerTest {
|
||||||
|
|
||||||
private static Context context;
|
private static Context context;
|
||||||
|
|
|
@ -44,11 +44,11 @@ class TypeSerializerTest extends ModuleEnvironmentTest {
|
||||||
static {
|
static {
|
||||||
INSTANCE.list.addAll(Lists.newArrayList(50, 51, -52, -53));
|
INSTANCE.list.addAll(Lists.newArrayList(50, 51, -52, -53));
|
||||||
|
|
||||||
INSTANCE.animals.add(new Dog<>(1, new Vector3f(3.15f, 54.51f, -0.001f), new org.joml.Vector3f(10.0f,30.0f,-0.001f)));
|
INSTANCE.animals.add(new Dog<>(1, new Vector3f(3.15f, 54.51f, -0.001f), new org.joml.Vector3f(10.0f, 30.0f, -0.001f)));
|
||||||
|
|
||||||
INSTANCE.animals.add(new Cheetah<>(2, Color.MAGENTA));
|
INSTANCE.animals.add(new Cheetah<>(2, Color.MAGENTA));
|
||||||
|
|
||||||
INSTANCE.singleAnimal = new Dog<>(2, new Vector3f(4, 5, 6), new org.joml.Vector3f(4,5.8f,8));
|
INSTANCE.singleAnimal = new Dog<>(2, new Vector3f(4, 5, 6), new org.joml.Vector3f(4, 5.8f, 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
private TypeHandlerLibrary typeHandlerLibrary;
|
private TypeHandlerLibrary typeHandlerLibrary;
|
||||||
|
@ -81,7 +81,7 @@ class TypeSerializerTest extends ModuleEnvironmentTest {
|
||||||
@Test
|
@Test
|
||||||
void testDeserialize() {
|
void testDeserialize() {
|
||||||
Optional<SomeClass<Integer>> deserialize = gsonSerializer.deserialize(
|
Optional<SomeClass<Integer>> deserialize = gsonSerializer.deserialize(
|
||||||
new TypeInfo<SomeClass<Integer>>() {},
|
new TypeInfo<SomeClass<Integer>>() { },
|
||||||
INSTANCE_JSON.getBytes(TerasologyConstants.CHARSET));
|
INSTANCE_JSON.getBytes(TerasologyConstants.CHARSET));
|
||||||
assertTrue(deserialize.isPresent());
|
assertTrue(deserialize.isPresent());
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ class TypeSerializerTest extends ModuleEnvironmentTest {
|
||||||
|
|
||||||
//noinspection unchecked,OptionalGetWithoutIsPresent,OptionalGetWithoutIsPresent
|
//noinspection unchecked,OptionalGetWithoutIsPresent,OptionalGetWithoutIsPresent
|
||||||
SomeClass<Integer> deserializedInstance =
|
SomeClass<Integer> deserializedInstance =
|
||||||
(SomeClass<Integer>) gsonSerializer.deserialize(new TypeInfo<SomeClass<Integer>>() {}, bytes)
|
(SomeClass<Integer>) gsonSerializer.deserialize(new TypeInfo<SomeClass<Integer>>() { }, bytes)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
assertNotEmpty(typeHandlerLibrary.getTypeHandler(Animal.class));
|
assertNotEmpty(typeHandlerLibrary.getTypeHandler(Animal.class));
|
||||||
|
@ -130,9 +130,9 @@ class TypeSerializerTest extends ModuleEnvironmentTest {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SomeClass<?> someClass = (SomeClass<?>) o;
|
SomeClass<?> someClass = (SomeClass<?>) o;
|
||||||
return Objects.equals(data, someClass.data) &&
|
return Objects.equals(data, someClass.data)
|
||||||
Objects.equals(list, someClass.list) &&
|
&& Objects.equals(list, someClass.list)
|
||||||
Objects.equals(animals, someClass.animals);
|
&& Objects.equals(animals, someClass.animals);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,8 +21,6 @@ import org.terasology.persistence.serializers.Serializer;
|
||||||
import org.terasology.persistence.typeHandling.TypeHandlerLibrary;
|
import org.terasology.persistence.typeHandling.TypeHandlerLibrary;
|
||||||
import org.terasology.reflection.TypeInfo;
|
import org.terasology.reflection.TypeInfo;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static org.terasology.joml.test.VectorAssert.assertEquals;
|
import static org.terasology.joml.test.VectorAssert.assertEquals;
|
||||||
|
|
||||||
@SuppressWarnings("FieldCanBeLocal")
|
@SuppressWarnings("FieldCanBeLocal")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2020 The Terasology Foundation
|
// Copyright 2021 The Terasology Foundation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
package org.terasology.engine.entitySystem;
|
package org.terasology.engine.entitySystem;
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class OwnershipHelperTest {
|
public class OwnershipHelperTest {
|
||||||
|
|
||||||
private static ModuleManager moduleManager;
|
private static ModuleManager moduleManager;
|
||||||
|
@ -41,7 +39,7 @@ public class OwnershipHelperTest {
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
ContextImpl context = new ContextImpl();
|
ContextImpl context = new ContextImpl();
|
||||||
context.put( ModuleManager.class, moduleManager);
|
context.put(ModuleManager.class, moduleManager);
|
||||||
NetworkSystem networkSystem = mock(NetworkSystem.class);
|
NetworkSystem networkSystem = mock(NetworkSystem.class);
|
||||||
when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
|
when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
|
||||||
context.put(NetworkSystem.class, networkSystem);
|
context.put(NetworkSystem.class, networkSystem);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2020 The Terasology Foundation
|
// Copyright 2021 The Terasology Foundation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
package org.terasology.engine.entitySystem;
|
package org.terasology.engine.entitySystem;
|
||||||
|
|
||||||
|
@ -29,8 +29,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class PojoEntityPoolTest {
|
public class PojoEntityPoolTest {
|
||||||
|
|
||||||
private PojoEntityPool pool;
|
private PojoEntityPool pool;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.entitySystem.metadata;
|
package org.terasology.engine.entitySystem.metadata;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.entitySystem.metadata.internal;
|
package org.terasology.engine.entitySystem.metadata.internal;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -28,8 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class MetadataBuilderTest {
|
public class MetadataBuilderTest {
|
||||||
|
|
||||||
private ReflectFactory factory = new ReflectionReflectFactory();
|
private ReflectFactory factory = new ReflectionReflectFactory();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2020 The Terasology Foundation
|
// Copyright 2021 The Terasology Foundation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package org.terasology.fixtures;
|
package org.terasology.fixtures;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2020 The Terasology Foundation
|
// Copyright 2021 The Terasology Foundation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package org.terasology.fixtures;
|
package org.terasology.fixtures;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2020 The Terasology Foundation
|
// Copyright 2021 The Terasology Foundation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package org.terasology.fixtures;
|
package org.terasology.fixtures;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2020 The Terasology Foundation
|
// Copyright 2021 The Terasology Foundation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package org.terasology.fixtures;
|
package org.terasology.fixtures;
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class TranslationFormatTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultiLine() throws IOException, InvalidAssetFilenameException{
|
public void testMultiLine() throws IOException, InvalidAssetFilenameException {
|
||||||
byte[] resource = createSimpleMultiLineTranslationFile().getBytes(StandardCharsets.UTF_8);
|
byte[] resource = createSimpleMultiLineTranslationFile().getBytes(StandardCharsets.UTF_8);
|
||||||
AssetDataFile assetDataFile = mockAssetDataFile("game.lang", resource);
|
AssetDataFile assetDataFile = mockAssetDataFile("game.lang", resource);
|
||||||
ResourceUrn urn = createUrnFromFile(format, assetDataFile);
|
ResourceUrn urn = createUrnFromFile(format, assetDataFile);
|
||||||
|
@ -115,7 +115,7 @@ public class TranslationFormatTests {
|
||||||
return new ResourceUrn("engine:" + assetName.toString());
|
return new ResourceUrn("engine:" + assetName.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String createSimpleMultiLineTranslationFile(){
|
private static String createSimpleMultiLineTranslationFile() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("{");
|
sb.append("{");
|
||||||
sb.append("\"multi-line\": [\"line 1 \n \",\"line 2 \n \",\"line 3\"],");
|
sb.append("\"multi-line\": [\"line 1 \n \",\"line 2 \n \",\"line 3\"],");
|
||||||
|
|
|
@ -1,27 +1,12 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.identity;
|
package org.terasology.engine.identity;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class CertificateTests {
|
public class CertificateTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.identity;
|
package org.terasology.engine.identity;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -23,9 +10,7 @@ import java.nio.charset.Charset;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class MasterSecretGeneratorTests {
|
public class MasterSecretGeneratorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.identity.storageServiceClient;
|
package org.terasology.engine.identity.storageServiceClient;
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.identity.storageServiceClient;
|
package org.terasology.engine.identity.storageServiceClient;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.logic.behavior;
|
package org.terasology.logic.behavior;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.logic.behavior;
|
package org.terasology.logic.behavior;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.logic.behavior;
|
package org.terasology.logic.behavior;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.logic.behavior;
|
package org.terasology.logic.behavior;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -55,10 +42,10 @@ public final class Example {
|
||||||
treeBuilder.registerDecorator("repeat", Repeat.class);
|
treeBuilder.registerDecorator("repeat", Repeat.class);
|
||||||
actor = new Actor(null);
|
actor = new Actor(null);
|
||||||
actor.setDelta(0.1f);
|
actor.setDelta(0.1f);
|
||||||
node = treeBuilder.fromJson("{ sequence:[ " +
|
node = treeBuilder.fromJson(
|
||||||
"{repeat :{ count:5, child:{print:{msg:x}}}}, success, { delay:{duration:1}}, { print:{msg:Hello} }, { delay:{duration:1}}, { print:{msg:World} } "
|
"{ sequence:[ "
|
||||||
+
|
+ "{repeat :{ count:5, child:{print:{msg:x}}}}, success, { delay:{duration:1}}, { print:{msg:Hello} }, { delay:{duration:1}}, { print:{msg:World} } "
|
||||||
"] }");
|
+ "] }");
|
||||||
tree = new DefaultBehaviorTreeRunner(node, actor);
|
tree = new DefaultBehaviorTreeRunner(node, actor);
|
||||||
for (int i = 0; i < 100; i++) {
|
for (int i = 0; i < 100; i++) {
|
||||||
tree.step();
|
tree.step();
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.logic.behavior;
|
package org.terasology.logic.behavior;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Disabled;
|
import org.junit.jupiter.api.Disabled;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.logic.behavior;
|
package org.terasology.logic.behavior;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.logic.behavior;
|
package org.terasology.logic.behavior;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -6,8 +6,6 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class KinematicCharacterMoverTest {
|
public class KinematicCharacterMoverTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.logic.console;
|
package org.terasology.engine.logic.console;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@ import static org.terasology.joml.test.QuaternionAssert.assertEquals;
|
||||||
import static org.terasology.joml.test.VectorAssert.assertEquals;
|
import static org.terasology.joml.test.VectorAssert.assertEquals;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
@Tag("TteTest")
|
@Tag("TteTest")
|
||||||
public class LocationComponentTest extends TerasologyTestingEnvironment {
|
public class LocationComponentTest extends TerasologyTestingEnvironment {
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.math;
|
package org.terasology.math;
|
||||||
|
|
||||||
|
@ -29,20 +16,18 @@ import java.util.Set;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class Diamond3iIteratorTest {
|
public class Diamond3iIteratorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testZeroDistanceIteration() {
|
public void testZeroDistanceIteration() {
|
||||||
Iterator<Vector3ic> iter = Diamond3iIterable.region(new org.joml.Vector3i(),0).build().iterator();
|
Iterator<Vector3ic> iter = Diamond3iIterable.region(new org.joml.Vector3i(), 0).build().iterator();
|
||||||
assertEquals(Lists.newArrayList(new Vector3i()), Lists.newArrayList(iter));
|
assertEquals(Lists.newArrayList(new Vector3i()), Lists.newArrayList(iter));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOneDistanceIteration() {
|
public void testOneDistanceIteration() {
|
||||||
Iterator<Vector3ic> iter = Diamond3iIterable.region(new Vector3i(),1).build().iterator();
|
Iterator<Vector3ic> iter = Diamond3iIterable.region(new Vector3i(), 1).build().iterator();
|
||||||
Set<Vector3i> expected = Sets.newHashSet(new Vector3i(), new Vector3i(1, 0, 0), new Vector3i(-1, 0, 0), new Vector3i(0, 1, 0),
|
Set<Vector3i> expected = Sets.newHashSet(new Vector3i(), new Vector3i(1, 0, 0), new Vector3i(-1, 0, 0), new Vector3i(0, 1, 0),
|
||||||
new Vector3i(0, -1, 0), new Vector3i(0, 0, 1), new Vector3i(0, 0, -1));
|
new Vector3i(0, -1, 0), new Vector3i(0, 0, 1), new Vector3i(0, 0, -1));
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
@ -55,7 +40,7 @@ public class Diamond3iIteratorTest {
|
||||||
@Test
|
@Test
|
||||||
public void testTwoDistanceIteration() {
|
public void testTwoDistanceIteration() {
|
||||||
int cc = 0;
|
int cc = 0;
|
||||||
for (Vector3ic next : Diamond3iIterable.region(new Vector3i(), 2).build()){
|
for (Vector3ic next : Diamond3iIterable.region(new Vector3i(), 2).build()) {
|
||||||
assertTrue(next.gridDistance(new Vector3i()) <= 2);
|
assertTrue(next.gridDistance(new Vector3i()) <= 2);
|
||||||
cc++;
|
cc++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.math;
|
package org.terasology.math;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Nested;
|
import org.junit.jupiter.api.Nested;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.math;
|
package org.terasology.math;
|
||||||
|
|
||||||
import org.junit.jupiter.api.AfterAll;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
|
@ -30,9 +17,7 @@ import java.util.List;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class IntMathTest {
|
public class IntMathTest {
|
||||||
public IntMathTest() {
|
public IntMathTest() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2015 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.math;
|
package org.terasology.math;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.math;
|
package org.terasology.math;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
@ -30,8 +17,6 @@ import org.terasology.engine.math.Yaw;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.terasology.joml.test.QuaternionAssert.assertEquals;
|
import static org.terasology.joml.test.QuaternionAssert.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class RotationTest {
|
public class RotationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.math;
|
package org.terasology.math;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -21,8 +8,6 @@ import org.terasology.engine.math.Side;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class SideTest {
|
public class SideTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.network;
|
package org.terasology.engine.network;
|
||||||
|
|
||||||
|
@ -37,8 +24,6 @@ import java.util.List;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
@Tag("TteTest")
|
@Tag("TteTest")
|
||||||
public class TestNetwork extends TerasologyTestingEnvironment {
|
public class TestNetwork extends TerasologyTestingEnvironment {
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.particles;
|
package org.terasology.engine.particles;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.particles.updating;
|
package org.terasology.engine.particles.updating;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.persistence;
|
package org.terasology.engine.persistence;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
@ -34,8 +21,6 @@ import java.io.OutputStreamWriter;
|
||||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class EntityDataJSONFormatTest {
|
public class EntityDataJSONFormatTest {
|
||||||
|
|
||||||
public static final String VALUE_NAME = "Name";
|
public static final String VALUE_NAME = "Name";
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2015 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.persistence;
|
package org.terasology.engine.persistence;
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.persistence;
|
package org.terasology.engine.persistence;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Tag;
|
import org.junit.jupiter.api.Tag;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.persistence.internal;
|
package org.terasology.engine.persistence.internal;
|
||||||
|
|
||||||
import org.codehaus.plexus.util.FileUtils;
|
import org.codehaus.plexus.util.FileUtils;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.persistence.typeHandling.gson;
|
package org.terasology.engine.persistence.typeHandling.gson;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
@ -66,7 +53,7 @@ public class GsonTypeHandlerAdapterTest {
|
||||||
assertEquals(OBJECT_JSON_ARRAY, serializedObject);
|
assertEquals(OBJECT_JSON_ARRAY, serializedObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class TestClass {
|
private static final class TestClass {
|
||||||
private final Color color;
|
private final Color color;
|
||||||
private final int i;
|
private final int i;
|
||||||
|
|
||||||
|
@ -77,11 +64,15 @@ public class GsonTypeHandlerAdapterTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) {
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
TestClass testClass = (TestClass) o;
|
TestClass testClass = (TestClass) o;
|
||||||
return i == testClass.i &&
|
return i == testClass.i
|
||||||
Objects.equals(color, testClass.color);
|
&& Objects.equals(color, testClass.color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
public class GsonTypeHandlerLibraryAdapterFactoryTest {
|
public class GsonTypeHandlerLibraryAdapterFactoryTest {
|
||||||
private static final TestClass OBJECT = new TestClass(
|
private static final TestClass OBJECT = new TestClass(
|
||||||
new Color(0xDEADBEEF),
|
new Color(0xDEADBEEF),
|
||||||
ImmutableSet.of(new Vector4f(0,0,0,0), new Vector4f(1,1,1,1)),
|
ImmutableSet.of(new Vector4f(0, 0, 0, 0), new Vector4f(1, 1, 1, 1)),
|
||||||
ImmutableMap.of(
|
ImmutableMap.of(
|
||||||
"someRect",
|
"someRect",
|
||||||
new Rectanglei(-3, -3).setSize(10, 10)
|
new Rectanglei(-3, -3).setSize(10, 10)
|
||||||
|
@ -57,14 +57,11 @@ public class GsonTypeHandlerLibraryAdapterFactoryTest {
|
||||||
assertEquals(OBJECT, deserializedObject);
|
assertEquals(OBJECT, deserializedObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class TestClass {
|
private static final class TestClass {
|
||||||
private final Color color;
|
private final Color color;
|
||||||
private final Set<Vector4f> vector4fs;
|
private final Set<Vector4f> vector4fs;
|
||||||
private final Map<String, Rectanglei> rectangleiMap;
|
private final Map<String, Rectanglei> rectangleiMap;
|
||||||
|
|
||||||
// Will not be serialized
|
|
||||||
private final Map<Integer, Integer> intMap;
|
|
||||||
|
|
||||||
private final int i;
|
private final int i;
|
||||||
|
|
||||||
private TestClass(Color color, Set<Vector4f> vector4fs, Map<String, Rectanglei> rectangleiMap,
|
private TestClass(Color color, Set<Vector4f> vector4fs, Map<String, Rectanglei> rectangleiMap,
|
||||||
|
@ -72,19 +69,23 @@ public class GsonTypeHandlerLibraryAdapterFactoryTest {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.vector4fs = vector4fs;
|
this.vector4fs = vector4fs;
|
||||||
this.rectangleiMap = rectangleiMap;
|
this.rectangleiMap = rectangleiMap;
|
||||||
this.intMap = intMap;
|
// Will not be serialized
|
||||||
this.i = i;
|
this.i = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) {
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
TestClass testClass = (TestClass) o;
|
TestClass testClass = (TestClass) o;
|
||||||
return i == testClass.i &&
|
return i == testClass.i
|
||||||
Objects.equals(color, testClass.color) &&
|
&& Objects.equals(color, testClass.color)
|
||||||
Objects.equals(vector4fs, testClass.vector4fs) &&
|
&& Objects.equals(vector4fs, testClass.vector4fs)
|
||||||
Objects.equals(rectangleiMap, testClass.rectangleiMap);
|
&& Objects.equals(rectangleiMap, testClass.rectangleiMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.persistence.typeHandling.gson;
|
package org.terasology.engine.persistence.typeHandling.gson;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
@ -41,9 +28,7 @@ public class PolymorphicTypeAdapterFactoryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInterfaceReference() {
|
public void testInterfaceReference() {
|
||||||
Walker walker = CAT;
|
String json = interfaceGson.toJson(CAT);
|
||||||
|
|
||||||
String json = interfaceGson.toJson(walker);
|
|
||||||
|
|
||||||
Walker newAnimal = interfaceGson.fromJson(json, Walker.class);
|
Walker newAnimal = interfaceGson.fromJson(json, Walker.class);
|
||||||
|
|
||||||
|
@ -52,9 +37,7 @@ public class PolymorphicTypeAdapterFactoryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBaseClassReference() {
|
public void testBaseClassReference() {
|
||||||
Animal animal = CHEETAH;
|
String json = baseClassGson.toJson(CHEETAH);
|
||||||
|
|
||||||
String json = baseClassGson.toJson(animal);
|
|
||||||
|
|
||||||
Animal newAnimal = baseClassGson.fromJson(json, Animal.class);
|
Animal newAnimal = baseClassGson.fromJson(json, Animal.class);
|
||||||
|
|
||||||
|
@ -98,7 +81,7 @@ public class PolymorphicTypeAdapterFactoryTest {
|
||||||
assertTrue(newWalkers.get(2) instanceof Cheetah);
|
assertTrue(newWalkers.get(2) instanceof Cheetah);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Capsule {
|
private static final class Capsule {
|
||||||
private final Animal animal;
|
private final Animal animal;
|
||||||
|
|
||||||
private Capsule(Animal animal) {
|
private Capsule(Animal animal) {
|
||||||
|
@ -118,14 +101,18 @@ public class PolymorphicTypeAdapterFactoryTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) {
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Animal animal = (Animal) o;
|
Animal animal = (Animal) o;
|
||||||
return Objects.equals(name, animal.name);
|
return Objects.equals(name, animal.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Dog extends Animal {
|
private static final class Dog extends Animal {
|
||||||
private final float tailLength;
|
private final float tailLength;
|
||||||
|
|
||||||
private Dog(float tailLength) {
|
private Dog(float tailLength) {
|
||||||
|
@ -135,9 +122,15 @@ public class PolymorphicTypeAdapterFactoryTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) {
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
return true;
|
||||||
if (!super.equals(o)) return false;
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!super.equals(o)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Dog dog = (Dog) o;
|
Dog dog = (Dog) o;
|
||||||
return Float.compare(dog.tailLength, tailLength) == 0;
|
return Float.compare(dog.tailLength, tailLength) == 0;
|
||||||
}
|
}
|
||||||
|
@ -153,9 +146,15 @@ public class PolymorphicTypeAdapterFactoryTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) {
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
return true;
|
||||||
if (!super.equals(o)) return false;
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!super.equals(o)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Cheetah cheetah = (Cheetah) o;
|
Cheetah cheetah = (Cheetah) o;
|
||||||
return spotCount == cheetah.spotCount;
|
return spotCount == cheetah.spotCount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
# * Copyright 2015 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.persistence.typeHandling.mathTypes;
|
package org.terasology.engine.persistence.typeHandling.mathTypes;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.reflection;
|
package org.terasology.reflection;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.reflection.copy.strategy;
|
package org.terasology.reflection.copy.strategy;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
@ -26,8 +13,6 @@ import java.util.Set;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class MapCopyStrategyTest {
|
public class MapCopyStrategyTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -15,8 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class ByteCodeReflectFactoryTest {
|
public class ByteCodeReflectFactoryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class ConstructorLibraryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testArray() {
|
public void testArray() {
|
||||||
ObjectConstructor<List<String>[]> constructor = library.get(new TypeInfo<List<String>[]>() {});
|
ObjectConstructor<List<String>[]> constructor = library.get(new TypeInfo<List<String>[]>() { });
|
||||||
|
|
||||||
List<String>[] constructed = constructor.construct();
|
List<String>[] constructed = constructor.construct();
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class ConstructorLibraryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultidimensionalArray() {
|
public void testMultidimensionalArray() {
|
||||||
ObjectConstructor<String[][]> constructor = library.get(new TypeInfo<String[][]>() {});
|
ObjectConstructor<String[][]> constructor = library.get(new TypeInfo<String[][]>() { });
|
||||||
|
|
||||||
String[][] constructed = constructor.construct();
|
String[][] constructed = constructor.construct();
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,7 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.reflection.reflect;
|
package org.terasology.reflection.reflect;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public final class PrivateComponent {
|
public final class PrivateComponent {
|
||||||
|
|
||||||
private PrivateComponent() {
|
private PrivateComponent() {
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.registry;
|
package org.terasology.engine.registry;
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.engine.registry;
|
package org.terasology.engine.registry;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering;
|
package org.terasology.rendering;
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.animation;
|
package org.terasology.rendering.animation;
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.assets.texture;
|
package org.terasology.rendering.assets.texture;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2015 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.assets.texture;
|
package org.terasology.rendering.assets.texture;
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2013 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.assets.texture;
|
package org.terasology.rendering.assets.texture;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -27,8 +14,6 @@ import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class TextureDataFactoryTest {
|
public class TextureDataFactoryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -10,8 +10,6 @@ import org.terasology.nui.Color;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class TextureUtilTest {
|
public class TextureUtilTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.dag;
|
package org.terasology.rendering.dag;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2017 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.dag;
|
package org.terasology.rendering.dag;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.layouts;
|
package org.terasology.rendering.nui.layouts;
|
||||||
|
|
||||||
import org.joml.Vector2i;
|
import org.joml.Vector2i;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2014 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.layouts;
|
package org.terasology.rendering.nui.layouts;
|
||||||
|
|
||||||
import org.joml.Vector2i;
|
import org.joml.Vector2i;
|
||||||
|
@ -112,14 +99,16 @@ public class ColumnLayoutTest {
|
||||||
// Gets one-fifth of entire area
|
// Gets one-fifth of entire area
|
||||||
verify(canvas).drawWidget(itemAt2x1, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2, ((CANVAS_HEIGHT - 20) / 2), CANVAS_WIDTH * 2 / 10, 10));
|
verify(canvas).drawWidget(itemAt2x1, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2, ((CANVAS_HEIGHT - 20) / 2), CANVAS_WIDTH * 2 / 10, 10));
|
||||||
// Gets three-tens of entire area
|
// Gets three-tens of entire area
|
||||||
verify(canvas).drawWidget(itemAt3x1, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2 + CANVAS_WIDTH * 2 / 10, ((CANVAS_HEIGHT - 20) / 2), CANVAS_WIDTH * 3 / 10, 10));
|
verify(canvas).drawWidget(itemAt3x1, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2 + CANVAS_WIDTH * 2 / 10,
|
||||||
|
((CANVAS_HEIGHT - 20) / 2), CANVAS_WIDTH * 3 / 10, 10));
|
||||||
|
|
||||||
// Gets half of entire area
|
// Gets half of entire area
|
||||||
verify(canvas).drawWidget(itemAt1x2, RectUtility.createFromMinAndSize(0, ((CANVAS_HEIGHT - 20) / 2) + 10, CANVAS_WIDTH / 2, 10));
|
verify(canvas).drawWidget(itemAt1x2, RectUtility.createFromMinAndSize(0, ((CANVAS_HEIGHT - 20) / 2) + 10, CANVAS_WIDTH / 2, 10));
|
||||||
// Gets one-fifth of entire area
|
// Gets one-fifth of entire area
|
||||||
verify(canvas).drawWidget(itemAt2x2, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2, ((CANVAS_HEIGHT - 20) / 2) + 10, CANVAS_WIDTH * 2 / 10, 10));
|
verify(canvas).drawWidget(itemAt2x2, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2, ((CANVAS_HEIGHT - 20) / 2) + 10, CANVAS_WIDTH * 2 / 10, 10));
|
||||||
// Gets three-tens of entire area
|
// Gets three-tens of entire area
|
||||||
verify(canvas).drawWidget(itemAt3x2, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2 + CANVAS_WIDTH * 2 / 10, ((CANVAS_HEIGHT - 20) / 2) + 10, CANVAS_WIDTH * 3 / 10, 10));
|
verify(canvas).drawWidget(itemAt3x2, RectUtility.createFromMinAndSize(CANVAS_WIDTH / 2 + CANVAS_WIDTH * 2 / 10,
|
||||||
|
((CANVAS_HEIGHT - 20) / 2) + 10, CANVAS_WIDTH * 3 / 10, 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.layouts;
|
package org.terasology.rendering.nui.layouts;
|
||||||
|
|
||||||
import org.joml.Vector2i;
|
import org.joml.Vector2i;
|
||||||
|
|
|
@ -1,25 +1,12 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.layouts;
|
package org.terasology.rendering.nui.layouts;
|
||||||
|
|
||||||
import org.terasology.joml.geom.Rectanglei;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.joml.Vector2f;
|
import org.joml.Vector2f;
|
||||||
import org.joml.Vector2i;
|
import org.joml.Vector2i;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.terasology.joml.geom.Rectanglei;
|
||||||
import org.terasology.nui.Canvas;
|
import org.terasology.nui.Canvas;
|
||||||
import org.terasology.nui.layouts.ZoomableLayout;
|
import org.terasology.nui.layouts.ZoomableLayout;
|
||||||
|
|
||||||
|
@ -114,12 +101,19 @@ public class ZoomableLayoutTest {
|
||||||
//world size scaled to fit ratio of screen size - world size now 200 x 100
|
//world size scaled to fit ratio of screen size - world size now 200 x 100
|
||||||
assertEquals(zoomableLayout.getWindowSize(), new Vector2f(WORLD_WIDTH * 2, WORLD_HEIGHT));
|
assertEquals(zoomableLayout.getWindowSize(), new Vector2f(WORLD_WIDTH * 2, WORLD_HEIGHT));
|
||||||
assertEquals(zoomableLayout.getScreenSize(), new Vector2i(CANVAS_WIDTH, CANVAS_HEIGHT));
|
assertEquals(zoomableLayout.getScreenSize(), new Vector2i(CANVAS_WIDTH, CANVAS_HEIGHT));
|
||||||
assertEquals(zoomableLayout.getPixelSize(), new Vector2f(CANVAS_WIDTH / (WORLD_WIDTH * 2), CANVAS_HEIGHT / WORLD_HEIGHT));
|
assertEquals(zoomableLayout.getPixelSize(),
|
||||||
|
new Vector2f(CANVAS_WIDTH / (WORLD_WIDTH * 2), CANVAS_HEIGHT / WORLD_HEIGHT));
|
||||||
|
|
||||||
//coordinates on widgets scaled down by half
|
//coordinates on widgets scaled down by half
|
||||||
verify(canvas).drawWidget(item1, new Rectanglei(new Vector2i(ceilToInt(pos1.x / 2), ceilToInt(pos1.y / 2)), new Vector2i(ceilToInt((pos1.x + size1.x) / 2), ceilToInt((pos1.y + size1.y) / 2))));
|
verify(canvas).drawWidget(item1, new Rectanglei(
|
||||||
verify(canvas).drawWidget(item2, new Rectanglei(new Vector2i(ceilToInt(pos2.x / 2), ceilToInt(pos2.y / 2)), new Vector2i(ceilToInt((pos2.x + size2.x) / 2), ceilToInt((pos2.y + size2.y) / 2))));
|
new Vector2i(ceilToInt(pos1.x / 2), ceilToInt(pos1.y / 2)),
|
||||||
verify(canvas).drawWidget(item3, new Rectanglei(new Vector2i(ceilToInt(pos3.x / 2), ceilToInt(pos3.y / 2)), new Vector2i(ceilToInt((pos3.x + size3.x) / 2), ceilToInt((pos3.y + size3.y) / 2))));
|
new Vector2i(ceilToInt((pos1.x + size1.x) / 2), ceilToInt((pos1.y + size1.y) / 2))));
|
||||||
|
verify(canvas).drawWidget(item2, new Rectanglei(
|
||||||
|
new Vector2i(ceilToInt(pos2.x / 2), ceilToInt(pos2.y / 2)),
|
||||||
|
new Vector2i(ceilToInt((pos2.x + size2.x) / 2), ceilToInt((pos2.y + size2.y) / 2))));
|
||||||
|
verify(canvas).drawWidget(item3, new Rectanglei(
|
||||||
|
new Vector2i(ceilToInt(pos3.x / 2), ceilToInt(pos3.y / 2)),
|
||||||
|
new Vector2i(ceilToInt((pos3.x + size3.x) / 2), ceilToInt((pos3.y + size3.y) / 2))));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,11 +129,18 @@ public class ZoomableLayoutTest {
|
||||||
//world size doubled
|
//world size doubled
|
||||||
assertEquals(zoomableLayout.getWindowSize(), new Vector2f(WORLD_WIDTH * 2 * 2, WORLD_HEIGHT * 2));
|
assertEquals(zoomableLayout.getWindowSize(), new Vector2f(WORLD_WIDTH * 2 * 2, WORLD_HEIGHT * 2));
|
||||||
assertEquals(zoomableLayout.getScreenSize(), new Vector2i(CANVAS_WIDTH, CANVAS_HEIGHT));
|
assertEquals(zoomableLayout.getScreenSize(), new Vector2i(CANVAS_WIDTH, CANVAS_HEIGHT));
|
||||||
assertEquals(zoomableLayout.getPixelSize(), new Vector2f(CANVAS_WIDTH / (WORLD_WIDTH * 2 * 2), CANVAS_HEIGHT / (WORLD_HEIGHT * 2)));
|
assertEquals(zoomableLayout.getPixelSize(),
|
||||||
|
new Vector2f(CANVAS_WIDTH / (WORLD_WIDTH * 2 * 2), CANVAS_HEIGHT / (WORLD_HEIGHT * 2)));
|
||||||
|
|
||||||
verify(canvas).drawWidget(item1, new Rectanglei(new Vector2i(ceilToInt(pos1.x / 4), ceilToInt(pos1.y / 4)), new Vector2i(ceilToInt((pos1.x + size1.x) / 4), ceilToInt((pos1.y + size1.y) / 4))));
|
verify(canvas).drawWidget(item1, new Rectanglei(
|
||||||
verify(canvas).drawWidget(item2, new Rectanglei(new Vector2i(ceilToInt(pos2.x / 4), ceilToInt(pos2.y / 4)), new Vector2i(ceilToInt((pos2.x + size2.x) / 4), ceilToInt((pos2.y + size2.y) / 4))));
|
new Vector2i(ceilToInt(pos1.x / 4), ceilToInt(pos1.y / 4)),
|
||||||
verify(canvas).drawWidget(item3, new Rectanglei(new Vector2i(ceilToInt(pos3.x / 4), ceilToInt(pos3.y / 4)), new Vector2i(ceilToInt((pos3.x + size3.x) / 4), ceilToInt((pos3.y + size3.y) / 4))));
|
new Vector2i(ceilToInt((pos1.x + size1.x) / 4), ceilToInt((pos1.y + size1.y) / 4))));
|
||||||
|
verify(canvas).drawWidget(item2, new Rectanglei(
|
||||||
|
new Vector2i(ceilToInt(pos2.x / 4), ceilToInt(pos2.y / 4)),
|
||||||
|
new Vector2i(ceilToInt((pos2.x + size2.x) / 4), ceilToInt((pos2.y + size2.y) / 4))));
|
||||||
|
verify(canvas).drawWidget(item3, new Rectanglei(
|
||||||
|
new Vector2i(ceilToInt(pos3.x / 4), ceilToInt(pos3.y / 4)),
|
||||||
|
new Vector2i(ceilToInt((pos3.x + size3.x) / 4), ceilToInt((pos3.y + size3.y) / 4))));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,20 +156,33 @@ public class ZoomableLayoutTest {
|
||||||
//world size halved
|
//world size halved
|
||||||
assertEquals(zoomableLayout.getWindowSize(), new Vector2f(WORLD_WIDTH, WORLD_HEIGHT / 2));
|
assertEquals(zoomableLayout.getWindowSize(), new Vector2f(WORLD_WIDTH, WORLD_HEIGHT / 2));
|
||||||
assertEquals(zoomableLayout.getScreenSize(), new Vector2i(CANVAS_WIDTH, CANVAS_HEIGHT));
|
assertEquals(zoomableLayout.getScreenSize(), new Vector2i(CANVAS_WIDTH, CANVAS_HEIGHT));
|
||||||
assertEquals(zoomableLayout.getPixelSize(), new Vector2f(CANVAS_WIDTH / WORLD_WIDTH, CANVAS_HEIGHT / (WORLD_HEIGHT / 2)));
|
assertEquals(zoomableLayout.getPixelSize(),
|
||||||
|
new Vector2f(CANVAS_WIDTH / WORLD_WIDTH, CANVAS_HEIGHT / (WORLD_HEIGHT / 2)));
|
||||||
|
|
||||||
verify(canvas).drawWidget(item1, new Rectanglei(new Vector2i(ceilToInt(pos1.x), ceilToInt(pos1.y)), new Vector2i(ceilToInt(pos1.x + size1.x), ceilToInt(pos1.y + size1.y))));
|
verify(canvas).drawWidget(item1, new Rectanglei(
|
||||||
verify(canvas).drawWidget(item2, new Rectanglei(new Vector2i(ceilToInt(pos2.x), ceilToInt(pos2.y)), new Vector2i(ceilToInt(pos2.x + size2.x), ceilToInt(pos2.y + size2.y))));
|
new Vector2i(ceilToInt(pos1.x), ceilToInt(pos1.y)),
|
||||||
verify(canvas).drawWidget(item3, new Rectanglei(new Vector2i(ceilToInt(pos3.x), ceilToInt(pos3.y)), new Vector2i(ceilToInt(pos3.x + size3.x), ceilToInt(pos3.y + size3.y))));
|
new Vector2i(ceilToInt(pos1.x + size1.x), ceilToInt(pos1.y + size1.y))));
|
||||||
|
verify(canvas).drawWidget(item2, new Rectanglei(
|
||||||
|
new Vector2i(ceilToInt(pos2.x), ceilToInt(pos2.y)),
|
||||||
|
new Vector2i(ceilToInt(pos2.x + size2.x), ceilToInt(pos2.y + size2.y))));
|
||||||
|
verify(canvas).drawWidget(item3, new Rectanglei(
|
||||||
|
new Vector2i(ceilToInt(pos3.x), ceilToInt(pos3.y)),
|
||||||
|
new Vector2i(ceilToInt(pos3.x + size3.x), ceilToInt(pos3.y + size3.y))));
|
||||||
|
|
||||||
//simulate drag to item2
|
//simulate drag to item2
|
||||||
zoomableLayout.setWindowPosition(pos2);
|
zoomableLayout.setWindowPosition(pos2);
|
||||||
zoomableLayout.onDraw(canvas);
|
zoomableLayout.onDraw(canvas);
|
||||||
|
|
||||||
//item1 out of canvas
|
//item1 out of canvas
|
||||||
verify(canvas).drawWidget(item1, new Rectanglei(new Vector2i(ceilToInt(pos1.x - pos2.x), ceilToInt(pos1.y - pos2.y)), new Vector2i(ceilToInt(pos1.x + size1.x - pos2.x), ceilToInt(pos1.y + size1.y - pos2.y))));
|
verify(canvas).drawWidget(item1, new Rectanglei(
|
||||||
verify(canvas).drawWidget(item2, new Rectanglei(new Vector2i(), new Vector2i(ceilToInt(size2.x), ceilToInt(size2.y))));
|
new Vector2i(ceilToInt(pos1.x - pos2.x), ceilToInt(pos1.y - pos2.y)),
|
||||||
verify(canvas).drawWidget(item3, new Rectanglei(new Vector2i(ceilToInt(pos3.x - pos2.x), ceilToInt(pos3.y - pos2.y)), new Vector2i(ceilToInt(pos3.x + size3.x - pos2.x), ceilToInt(pos3.y + size3.y - pos2.y))));
|
new Vector2i(ceilToInt(pos1.x + size1.x - pos2.x), ceilToInt(pos1.y + size1.y - pos2.y))));
|
||||||
|
verify(canvas).drawWidget(item2, new Rectanglei(
|
||||||
|
new Vector2i(),
|
||||||
|
new Vector2i(ceilToInt(size2.x), ceilToInt(size2.y))));
|
||||||
|
verify(canvas).drawWidget(item3, new Rectanglei(
|
||||||
|
new Vector2i(ceilToInt(pos3.x - pos2.x), ceilToInt(pos3.y - pos2.y)),
|
||||||
|
new Vector2i(ceilToInt(pos3.x + size3.x - pos2.x), ceilToInt(pos3.y + size3.y - pos2.y))));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.widgets.browser.data.basic;
|
package org.terasology.rendering.nui.widgets.browser.data.basic;
|
||||||
|
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2018 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.widgets.browser.data.basic;
|
package org.terasology.rendering.nui.widgets.browser.data.basic;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2015 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.widgets.browser.data.html;
|
package org.terasology.rendering.nui.widgets.browser.data.html;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.widgets.treeView;
|
package org.terasology.rendering.nui.widgets.treeView;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2016 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.rendering.nui.widgets.treeView;
|
package org.terasology.rendering.nui.widgets.treeView;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
/*
|
// Copyright 2021 The Terasology Foundation
|
||||||
* Copyright 2014 MovingBlocks
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
|
||||||
* 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.terasology.utilities;
|
package org.terasology.utilities;
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue