Skip to content

Commit

Permalink
finish two storages test
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenek-jonas committed Nov 7, 2023
1 parent a50530a commit 8441996
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,27 @@
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
*
* SPDX-License-Identifier: EPL-2.0
* #L%
*/

public class FirstRoot
{
private final String value = "First root value";

public String getValue()
{
return value;
}

@Override
public String toString()
{
return "FirstRoot{" +
"value='" + value + '\'' +
'}';
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,25 @@

public class SecondRoot
{
private Integer intValue = 50;
private char c = 'c';

@Override
public String toString()
{
return "SecondRoot{" +
"intValue=" + intValue +
", c=" + c +
'}';
}

public Integer getIntValue()
{
return intValue;
}

public char getC()
{
return c;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.eclipse.store.integrations.spring.boot.types.EclipseStoreSpringBoot;
import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand All @@ -31,18 +32,18 @@ public class TwoStoragesTest

@Autowired
@Qualifier("first_storage")
EmbeddedStorageManager first_storage;
EmbeddedStorageManager firstStorage;

@Autowired
@Qualifier("second_storage")
EmbeddedStorageManager second_storage;
EmbeddedStorageManager secondStorage;


@Test
void name()
{
System.out.println(first_storage.root());
System.out.println(second_storage.root());
Assertions.assertEquals("FirstRoot{value='First root value'}", firstStorage.root().toString());
Assertions.assertEquals("SecondRoot{intValue=50, c=c}", secondStorage.root().toString());
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
org.eclipse.store.first.storage-directory=${java.io.tmpdir}/${random.int}
org.eclipse.store.first.auto-start=false
org.eclipse.store.first.root=org.eclipse.store.integrations.spring.boot.types.storages.FirstRoot

org.eclipse.store.second.storage-directory=${java.io.tmpdir}/${random.int}
org.eclipse.store.second.auto-start=false
org.eclipse.store.second.root=org.eclipse.store.integrations.spring.boot.types.storages.SecondRoot

0 comments on commit 8441996

Please sign in to comment.